Correct, passive investment income does not constitute employment. By definition, passive income requires no/minimal work. If you're a very active day-trader, then yes, that could potentially be considered moonlighting by a program.
I'm not sure what about the concept of moonlighting is confusing to you. Any employment outside the residency program, for which someone is compensated for, can potentially be viewed as moonlighting.
Keep in mind it's the legal department that sets these rules--if you were the lawyer of a large hospital system, how would you define moonlighting? Would you be ok with young, overworked, and relatively inexperienced physicians spending more time engaged in activities outside the hospital? Activities that will take away their energy and increase risk of malpractice? No--as a lawyer, your primary concern is the hospital's liability if you do something wrong. So you limit residents' ability to do paid work outside the hospital. It has nothing to do with someone's residency program--these things are decided much above a PD's paygrade. Though, if moonlighting is allowed at the institution level, individual PD's can typically still ban/limit it within their particular program.
Please keep in mind I say this as someone with first-hand experience from two programs that interpreted moonlighting differently. You're welcome to disagree with me if you want, but I'm just here to help the OP not land in any hot water.