It's different in a sense that public works don't just create jobs, they also create public infrastructure that is then usable by, and materially beneficial to, everyone.
A space program would obviously create jobs, but 1) does it create as many jobs as infrastructure work, per unit of currency spent, and 2) does the output that it produces materially benefit the public?
Basically, it's not a question whether they should spend money on space program, or on handing out free food. It's a question of whether a space program is really the best bang for the buck in terms of creating jobs and other benefits.
And you could argue that it might be, because the space program will produce important long-term benefits. But short-term benefits will produce "interest", so to speak (if you can get more people out of poverty today, you'll get more people who can become scientists tomorrow - and it might not even be the same people, but their kids). So such an argument cannot be a mere hand-wave - it must present the numbers.