I don’t quite think government can be considered a nonprofit entity.

I have to disagree — government can also ensure access to services that would otherwise be unprofitable. Ironically, this is most true in rural areas, where government tends to be the most derided. Most rural areas would not have maintained roads, electrical service, or phone service without government subsidies. We take these things for granted due to their ubiquity, but they are ubiquitous precisely because government has ensured their presence.