or have an arguable, positive overall long-term return on investment hopefully, (e.g. infrastructure spending, sending smart kids to college)
or will enjoy widespread public support and provide non-monetary benefits, (e.g. public parks, libraries, maternity leave)
or will be widely accepted as a core function of government (e.g. police and military), or a morally good and virtuous act (e.g. caring for the disabled, foreign aid)
or will be the pet project of someone powerful, semi-useful, and inexpensive enough no-one cares to fight them over it (e.g. opera subsidy)
or will convince people they're one of the above regardless of the truth of the matter
or will be at risk of cancellation.
Fortunately, the rest of us not computers, and are happy that our tax dollars go to symphonies and art and orphanages and other "unproductive" works.