Definition as can be found on Wikipedia (as of today),
A nonprofit organization (US and UK), or not-for-profit organization (UK and others), often called an NPO or simply a nonprofit and non-commercial organization, often called an NCO, is an organization that uses surplus revenues to achieve its goals rather than distributing them as profit or dividends. While not-for-profit organizations are permitted to generate surplus revenues, they must be retained by the organization for its self-preservation, expansion, or plans. NPOs have controlling members or boards. Many have paid staff including management, while others employ unpaid volunteers and even executives who work with or without compensation (occasionally nominal). Where there is a token fee, in general, it is used to meet legal requirements for establishing a contract between the executive and the organization.
In other words, while there is nothing stopping the said organisation to generate revenue leading to a surplus or a profit, it is in the spirit of the designation that the profits be pumped back into the organisation to further its cause.