In this case it's the government which technically doesn't have to actually make money (budgets, tho), but it can work in non-governmental situations too. Maybe via consulting/support on the technology, grants/donations (OpenSSL, now), maybe just making it open to foster contributions and long-term maintenance[0]. Maybe the actual software isn't the company's main focus and open-sourcing the code is just a way of ensuring accountability and quality. IME, people are actually far more conscientious when they know they code/docs could be read by anyone for all time... even if it probably won't.
[0] I'll grant that this is probably quite rare. That's not the point... the point is that there are many potential reasons for open-sourcing.
https://www.fossjobs.net/ https://github.com/fossjobs/fossjobs/wiki/Resources
[ EDIT ] And, contra to your apparent contrasting of "open source" and "paid developers", gov.uk is both.