A similar argument could be made about public spending on education, that it only creates inflation. But of course education is a great way to increase productivity. Similar effects would probably follow from universal healthcare and a UBI: namely healthy, financially secure people can do things that have short-term costs but long-term benefits, like starting a new business, or doing a low-paid internship, learning new skills, and so on. Also, fewer sick-hours leads directly to increased productivity.