"Nonprofit", at least in the US, is usually shorthand for having received a 501c3 (or similar) designation from the IRS. It has little bearing on your ability to make money as an organization (with caveats like the public support calculations)
Source: Ran a nonprofit for a few years that made money doing software consulting
Source: Ran a nonprofit for a few years that made money doing software consulting