Do you happen to know your pH and hardness? Mollies generally prefer brackish water. A lot of people have success with them in hard alkaline water, but they usually don't do well in soft acidic water.
They could also have been bad stock or sick. Did you have them in quarantine? If not, watch the other fish closely for similar symptoms.