The business model is simple arbitrage of leased office space. Lease large amounts of office space from commercial landlords and then charge a premium renting fractions of it back to individuals and firms on more flexible terms, and with some added services. WeWork takes the risk of holding the lease and makes their money charging more per square foot for the space. The investment pitch on that would be that if you can create an efficient platform for doing so, you could do it at-scale almost anywhere in the world. On top of that, you can find other ways to monetize your customers through various other offerings. They started with that, and then layered a whole bunch of lifestyle nonsense on top of it to make it "cool" and increase the hype.
The problem is that it's a really marginal business with a massive risk profile. It's potentially viable as long as demand never goes down, but the moment there's a slowdown in demand for office space, they're left holding the bag. Even if it were a viable business, the valuation was extremely aggressive. My guess is that they probably had some long-term plan to get into owning their buildings rather than leasing them, or at least the founders probably convinced people that there was a plan, but the business as we understand it was probably not long-term viable in practice.
WeWork never would have been a going concern at all without years of effectively negative interest rates fuelling demand for high-risk ventures, and without grifter founders who were perfectly happy to sell a trillion-dollar idea that had no practical viability.