Well, I can probably answer HOW they are as they are, but not necessarily WHY. Although, for the WHY questions in biology, we must always look towards our evolution.
For how, then: Nails are made from a strong protein called ‘keratin’, which is the same thing that hair and, in other animals, hooves and horns are made of. The part of the nail we see (as some of it is embedded under the skin of our fingers), is known as the ‘nail plate’, and is translucent. So, the ‘colour’ we see is actually the colour of the underlying capillaries.
For why the nail plate is see through – well, I suppose a good question to answer is ‘why shouldn’t they be?’ If there is no evolutionary pressure towards nail plates which are, say, black, or striped etc. then it is more efficient for the body not to have to spend energy on making unecessary pigment!
I don’t know, I guess they could be a different colour because I think they are made out of the same stuff as horses hooves and dogs claws (I’m not 100% sure about that) and they can be different colours.