Why only put 21 million units in the source code?
Take note that there is no "21 millions" in bitcoin source code.
Satoshi set the initial block reward to 50 BTC and decided that bitcoin block reward is halved every 210,000 blocks. This makes the total supply approximately 21 millions.
The exact supply of bitcoin is 20,999,999.9769 BTC.