You say you ran your tank "for a bit". Do you mean you ran the filter? Do you know about cycling tanks, and do you have a test kit? IF you didn't cycle the tank, it's probably full of ammonia and nitrites and that's what killed the fish.
Also, 5 gals is way too small for even 2 adult platies, and way WAY too small for all those babies. Unless you get a much bigger tank, those babies won't make it. 22 platies would need around 40 gallons to grow to adult size.
If a few of them do survive, they will start breeding the second they're old enough, and I doubt anyone is going to buy platies, since as you see, they breed like rabbits and really have no value. Most pet stores won't even take them for free.
