Three reasons, no incentives, no competition and no fraud.
Unlike in private companies, government employees are often very hard to fire, even if they tragically underperform. If your salary does not depend at all on your performance, you play by the book, follow the rules and don't particularly care about putting in good work. You have no incentives to do so. It doesn't matter how the contractor you picked performs, as long as they can't prove negligence on your part, you're not getting fired. You won't be promoted either, even if they deliver under budget and months before the deadline.
In a private company, the owner wants to make money, so there's an incentive to perform. Underperforming employees (or even entire departments) are simply cut. If a company fails at this too badly (all companies fail to some extend), the entire company underperforms and loses customers. Ultimately, the market ensures that companies grow if they're good at this and shrink if they aren't.
With governments, this is, again, not the case. You aren't going to switch to a competing passport system and drive this one out of the market, no matter how badly it sucks. Metrics won't change much, no matter how bad the UX is, as the system provides a critical service which has no alternative. This is the no competition problem.
Private companies also have more freedom to pick contractors. It's really bad PR for the government if their employees choose contractors through nepotism, so laws have been passed that standardize the contractor selection process. This means that, even if you know a contractor is not the right choice, you may be prevented from doing anything about this. Because al rules can be gamed, most government contracts are won by companies who know how to game the rules, not those who make good software and would be chosen by a knowledgeable employee. This is the no fraud problem.