Why are apples red and green?
It just depends on the type of apple. Some apples are even yellow! The color is caused by pigments in the skin of the fruit.
Some apples are red when they are ripe and some are green when they are ripe. Neither type is "better for you" than the other. Those apples that are red when ripe are often green when they are not ripe. Eating those kinds of green apples (unripe apples) is not good for you. That is the only sense in which red apples are "better for you" than green apples.
I actually did an expirament on this topic. Red apples rot faster then green apples. This is due to the acidity in the green apple that keeps the green apple fresher. If you cut a green apple and a red apple in half, you will find that the red apple will start to brown slightly before the green apple.