When dealing with Qatar (or any of the small Gulf countries) it’s important to be sure you’re looking at the relevant population figures. In some of these countries the real locals / citizens / natives represent barely 20% of the people living / working there. Everybody else is a foreigner of some flavor usually on a temporary work contract.
Unlike the US or Europe, most of these petro-states’ government income comes from resource extraction, not taxes on the citizens and “guest” workers. The fiscal implications of government spending are not the same in these sorts of countries as we’re used to thinking about here at home.