Why was 21 million the number of bitcoins to be created?
Because that's how the mathematics worked out.
More specifically, it isn't 21 million. It's actually 20999999.9769. It's just easier for everyone to remember and say "There will never be more than 21 million created" than is is to say, "The maximum that could potentially have been created is twenty million nine hundred ninety-nine thousand nine hundred ninety-nine and nine thousand seven hundred sixty-nine ten-thousandths".
What Satoshi actually did was choose a reasonable sounding number 50 and decide that the block reward would be 50 bitcoins per block for the first 210,000 blocks. Then he decided that in order to have a fixed quantity, but not have a sudden drop off, the block reward would be cut in half every 210,000 blocks. If you do this cutting in half and adding up all the blocks (rounding down to the nearest satoshi value every time), you'll find that the exact amount of bitcoins that are created by the time the 6,930,000 the block is created is 20999999.9769
thanks a lot, DannyHamilton