There are, of course, a lot of reasons: generous compensation packages, job stability, and - oh yeah - it's almost impossible to get fired. I've personally known public-sector employees who called in sick when they were actually out doing the Seattle-to-Portland bicycle ride. They got a firm talking-to when the decption was uncovered; in the private sector, they'd be out the door for good.
At the end of the day, it's harder to fire a public sector employee. It requires more process, more documentation, more time.
No kidding. Most managers decide it's not worth the effort, so they simply retain the non-productive staff. They'll just hire more.
If you wonder how governments can grow to such size while accomplishing so little, wonder no more: it's how they're designed.