a) buy or rent commercial real estate
b) rent that same real estate out to people who want office space
As long as the money coming in from b is sufficiently greater than the money being spent on a, you should be good.
As far as profitability, the company is making investments now that will pay back over time. Since they are growing quickly, you'd expect them to take a loss since they have to make upfront investments in new offices (and on real estate, which they seem to be getting into the business of purchasing outright rather than taking out long term leases).
EDIT: I don't have an opinion one way or another on whether WeWork is a good business to invest in or not, but it's definitely a straightforward and easy to understand business, as opposed to say, a bank or a biotech company.