That's not entirely true - agencies get sued and loose lawsuits all the time. It would be accurate to say that while most people working for government don't have immunity, it's pretty rare for them to get affected personally* so effectively it is immunity.
Lack of oversight and accountability is the real reason for delays. They get away with it because no one holds them accountable for actually producing something in a timely manner.
*I wish I could find it - there is an example of some government employees who were held personally liable for some environmental violations - despite them complaining to upper management that they needed to be addressed. Was pretty f'd up. I think they were civilian employees in the military (for some reason I'm thinking Air Force but can't dig it up at the moment). So if you are low enough on the totem pole your but may get in a sling - but it's amazing how little the upper echelons seem to take hits.