Not just "fucking up really bad." Used to emphasize the way that the really bad fuck-up harms or humiliates the person who fucked up. The idea of shitting the bed is not just a) that the person intended to do one thing but instead laid a giant turd but also b) that the person laid that turd in their own bed and now has to lie in their bed of shit.
Darlene merely laid a turd by flunking the algebra test. Mike completely shit the bed when he cheated on the test and got caught and expelled from school.
One night after drinking heavily, I decided to give myself 2 IV bags cause I was super drunk. The good news was that I woke up without a hanger, bad news is that Purdued the bed. They really Shit the Bed