It's called a "sale leaseback", a common structure in real estate transactions.
My prediction: within a few years this money will all be spent. They will then have neither building nor cash, and at that point they will either completely go under or functionally cease to exist (a couple of token staff, no real operations).
I would have advised them to take out a mortgage against the building, and simultaneously lease out the majority of the building floor area for rent. Use the rent income to cover the mortgage payments. This way they get a bunch of cash immediately for their spending needs, and the rent income from their building lets them slowly pay down the mortgage with little risk. The interest on the mortgage is also tax deductible against their non-charity income. Finally, they also get to keep any value appreciation in their building as time passes. Eventually the mortgage will be paid off and they can do this again. Or, if their finances improve, they can choose to pay off the mortgage early.