Many people don't have good access to clean water, over 2B according to the repo's readme.
Those people probably cannot afford $150, but the goal of the project wasn't $150, it was lower.
The unit is supposed to be solar powered, so access to electricity isn't strictly necessary, in the sense of being able to connect to the grid. They just need sunlight.
There is a sweet spot of cost, where those who need it can't afford it, but nonprofits, billionaire philanthropists, and local governments can afford to purchase and distribute such devices where necessary. In cases where the need for clean water greatly outweighs the supply, such entities see a good return on investment, simply by improving the health of those people there.
Furthermore, X is a moonshot program at Google. They attempt solutions for big problems with high likeihood of failure. Are you suggesting they shouldn't do this with their money printing ad machine? It seems like any good that comes out of that company should be celebrated, and in this case they are sharing a bunch of work on solving what will be an increasing large problem for the entire world.