No, being open source does not make Stellar a nonprofit. What makes them a nonprofit is how they structured their legal entity.
By choosing to be a nonprofit they are stating that no shareholders will receive a share of the profits. Being a nonprofit also means that there are no owners of Stellar – as a nonprofit can legally have none in the United States. This would affect how Stellar raises any outside funds they need for seed/growth stages of their business. Donations could be made they would not receive equity or convertible notes in exchange.
A nonprofit can generate revenue from selling goods or services just like a for-profit business can. The difference is around ownership and the ultimate ends of the entity. A for-profit corporation has a legal obligation to pursue profits for their shareholders, a nonprofit does not.
Hope that helps clear things up!