Genes are best propogated by healthy individuals who can acquire the most food for themselves and their children.  Penguins like in the water and hunt for fish by swimming.  The most efficient foragers did not need to fly but needed to swim well.