(rambling, non caffeinated rant incoming)
Unfortunately, psychologists are fairly idealistic, which affects logical consideration of this subject. Basically, it's only a problem if it is a CONFLICT OF INTEREST. Everything costs money. It is completely ethical for entities to be compensated for their efforts, including ones you partially own. It is completely ethical for you to be paid for your services. Arguably, it is unethical to not pay someone for their work as it only benefits one side of the equation.
The problem arises when you have an investment that affects HOW you do your job. It's not unethical to own a majority stake of a local psychiatric hospital. It's not unethical to even send your patients to that hospital. It IS unethical to refer all of your patients to that hospital (it is also a federal crime at some point). It IS also unethical to fail to disclose conflict of interests to your patients, without offering choices. It IS ethical to disclose that conflict, and still do engage in that treatment if the patient chooses it. It IS unethical to get paid to send patients to a place (and a crime). Most psych drugs are off patent, so we don't have to worry about this too much. Every now and again, psychologists get in trouble for kickbacks with psych hospitals and rehab centers. Side note: They always lose their license for this, and they never get enough money to cover the loss of income, so it never makes sense to me.
In human subjects research, you have to complete that federal government training every two years, which outlines the specifics on this. IIRC, the federal government requires you to fill out formal disclosures on this but it's been a while. I never understood why psychotherapy research didn't have this. You do NOT screw around with the feds. And there is no reason to do consider screwing around with them. The guy who created the cure for Hep C was a VA employee, who was allowed to take his research with him to found his pharma company, and became a billionaire in like 5 years.
In presentations, our medical colleagues have to disclose this stuff. This is a very good idea, which fits with APA ethical codes. It lets people know that you are not a shill. You get up, say, "I own shares in this stock, so I might be biased", and the audience can put that into their consideration.
In investing, you should only invest in things you understand (according to Buffet). It is a federal crime to use information that is not publicly available, narrowly defined as corporate information (e.g., in your medical executive committee meeting, you learn that your hospital is going bankrupt). Insider information is NOT information that most people do not know (e.g., you notice your patients on a new drug all complain of diarrhea). Otherwise, your education and experience represents an edge in investing. It is completely ethical to invest in unhealthy foods, booze, pharma to treat things you see, treatment centers, credit cards, etc. People can make their own decisions, and substitute symptoms. Investing choices are only a problem if you using your influence with patients to drive them to use things that profit you. Outside of that, your investments can be guided by your own personal morals. I won't invest in several things, not because it would be unethical, but because I find the companies immoral. Or because I dislike the product or individual.