Actually the thing which kills this model nowadays is the obscene cost of real estate and the rentier class. Coffee shops simply can't be profitable as workspaces any more.
You still can see coffee spots as social places in developing countries.
But more people need these work spaces as they can't work in the closet like apartments they are sharing with 2-3 other people. You are correct in saying it's because cost of real estate