Yes, tax exempt/non-profit corporations are allowed to own property --real, personal, and intellectual-- and make money, including money from trademarked goods. It's important not to lose the tax exempt status if and when you get it, so make sure you have good corporate counsel and you know the rules. Please see the "how to" guides linked below.
And see an IP lawyer to acquire the trademark rights when you're ready to create some merchandise.
Avvo doesn't pay us for these responses, and I'm not your lawyer just because I answer this question or respond to any follow-up comments. If you want to hire me, please contact me. Otherwise, please don't expect a further response. We need an actual written agreement to form an attorney-client relationship. I'm only licensed in CA and you shouldn't rely on this answer, since each state has different laws, each situation is fact specific, and it's impossible to evaluate a legal problem without a comprehensive consultation and review of all the facts and documents at issue.
You can, but it is like any other source of income for a non-profit. Ultimately, you cannot keep those profits. Sometimes, licensing is very profitable for a non-profit company, which is why they sometimes use a for-profit IP holding company that owns their trademarks. They then license the trademarks from the holding company, shifting income from the non-profit to the for-profit company. You should definitely consult with a business attorney regarding these and other issues.
I am out of my league when it comes to the question of what it takes to acquire and preserve an organization's tax-exempt status. But some of the biggest tax exempt organizations are private universities, which typically license their names and logos for use on merchandise, and their patented technology in various fields from electronics to healthcare. Some such patents might be held in the name of a technology-transfer foundation, which itself would be a tax-exempt organization, such as the Wisconsin Alumni Research Foundation.
This posting is intended for general education and isn't "legal advice." It doesn't create or evidence an attorney-client relationship. You are encouraged to engage an attorney in the pertinent jurisdiction for confidential legal advice on matters of any importance.