'
What you're saying would make sense if I was talking about a CEO. But a scientist/doctor isn't valuable because they stimulate the economy. They'be valuable because they can save more lives than 5 homeless people can.
1.) You missed the point.
2.) The whole reason you chose 5 homeless men, rather than, say, 5 ordinary people (ordinary people don't save lives as a normal part of their day, either. In fact, ordinary people are more likely to harm than help you) is because you are tacitly arguing that the lives of homeless people are valueless or at least less valuable than the lives of anybody else.
3.) The only basis for such an argument that homeless people are less valuable than other people is productivism. There is no other possible perspective from which such an egregious and morally reprehensible position could be supported.
4.) A CEO stimulates the economy less than a factory worker does. In fact, a CEO is simply an overpaid psychopathic sinecure in a pinstripe suit and fancy office, who is much more likely to ruin an economy (they have the power to catapult entire nations into recession, which has happened and will inevitably happen again) than repair it (the reparation comes not from the corporate office, but the executive office of the Whitehouse in the USA in the form of bailouts, courtesy of the taxpayer. The CEO, after destroying everything, usually just glides away from the scene of the crime with a multi-million dollar golden parachute). If you think people like Al 'Chainsaw' Dunlap stimulate the economy, then you don't know shit from shinola.
But while deranged sociopaths like Mr. Beaucoup Bills or Al Dunlap can destroy economies, they're still regarded as the most valuable citizens because the wealthy are held as idols to be obsequiously worshipped by daft plebeians and proud peasants.
5.) A doctor and scientist does stimulate the economy. They keep bovine consumers and passive wage slaves from an early death; they prolong the lives of consumers and wage slaves; they discover new things for profiteers to profit from; thsy make a hell of a lot of money (well, the doctor does, anyway) with which to buy and consume things; etc.