What to do about bathroom ceiling peeling
In all likelihood, you put a modern water based paint over an older oil based paint.   

Peel off the paint, Put on a mask and go over the old paint with a random orbit sander just to rough it up a bit.  Wipe off the dust with a damp rag, and let it dry.  This would be a good time to go to your favourite orange or blue store to get some primer.  I happen to like Kilz, particularly for bathrooms.   Prime the ceiling, and let it dry thoroughly.

Now paint, letting it dry completely between coats, and avoid using the shower for a couple of days.