I build these sorts of things and while it's not trivial it's also really not that hard. It's just insane the amount of money the government will spend on crap.
The field I work in is pretty small and I know a decent amount of the developers that use it. One project I worked on for the government, I showed up on day one and ran into a few people that had either no desire or no ability to do development work. And they were in team lead/senior roles.
Then, come to find out that you can't do anything for the project until you have a background check. And, by anything, I mean anything. No meetings, e-mails, or anything with an armed guard enforcing it. So there was an office full of people billing out at $200+ an hour for months doing literally nothing.
Then, come to find out that the way they wanted the software couldn't do. Like within an hour of hearing the requirements and what they were building I knew that it (1) wasn't possible and (2) the design they chose had fundamental flaws. Several years of effort and 10s of millions of dollars later they gave up on it.
The government is just a big whale too dumb, corrupt, and/or lazy to defend itself while a gigantic swarm of consultants/vendors are ripping off hunks of its flesh like the sharks they are.