I think you are misunderstanding non-profits. Both compoanies for-profit and non-profits are out to make money. Neither could exist without a source of revenue. A for-profit company can do whatever it likes with the profit. Often, this results in the owner (if privately owned) getting a fat bonus check at the end of the year. In a publically traded company, dividends for share holders may be given out.
A non-profit cannot distribute excess funds. The extra money they have, the profit, must be used towards whatever its mission is. They can expdand the campus, give out scholarships, etx. So both types of companies are trying to make money. The purpose and use of that money is the difference