I think it's just one of those factoids that gets passed around through pop-culture because nobody takes the time to verify it.
Before reading the Snopes page just now, I would probably have said that I was pretty sure mailing cash was technically illegal. But thinking about it now, I have no idea where I got that idea from.
The Postal Service advises against it. You probably heard some postal official say "Don't mail cash" and mistook it as a citation of law rather than simple advice.
If a particular address was known to consistently receive cash in the mail, wouldn't that make it a target of theft?
As someone who lives in the Bay Area and has seen car windows smashed for the change in the cupholder and a friend's motorcycle knocked over to get the flattened soda can that was being used as a stabilizer, yes, that's a security concern.
A transient mailing of discrete paper cash is different than a call-to-action requesting coins that will be delivered to the same address on a regular basis.
Can't find a current USPS FAQ, though.