Simon Kuznets, a Russian emigre to the US, developed the concept of the GDP in 1934, and according to Bregman, tracking the GDP was a significant factor in the US's ability to harness its manufacturing capability during the war effort; most countries had a significantly inferior understanding of their own production dynamics.
As useful was it was for the war effort, Kuznets warned that the GDP should be redefined after the war, as the country's needs had changed. Instead, military spending is part of the GDP. No party wants to significantly cut back on military spending because it would affect the GDP. So not only does the GDP encourage increased military spending, it doesn't reward so many things that would be beneficial to society, and thus little effort is spent optimizing for those things.
TL;DR: if the GDP doesn't measure it, there is no political will to address it, and if the GDP does measure it, it is a political necessity to boost spending in that area. Thus, needless military spending, rent seeking money shuffling on wall street, and advertising are richly rewarded as they are included in the GDP.
The feeling has to do with the fact that where I live, nearly every software engineer you meet works for a defense contractor, an issuance company, or a finance company. These jobs, and the dollars that come from them, seem somehow hollow to me. I'd accept a significant pay cut if my code were somehow contributing to something like growing food.