You're misunderstanding the term "profit" in the legal phrase "non-profit."
I'm not defending high salaries at all non-profits. Yes, some people are overpaid despite being at a non-profit. But don't be confused about what the term "non-profit" means.