Neither is illegal[0]. I have no idea where they are getting this. USPS just changed a rule and now requires anything over $500 to be sent by registered mail.
FedEx/UPS/DHL have a policy where they won’t mail cash but it’s more of a terms of service violation, not illegal. Maybe if you lie to them about it that could be fraud or something but there’s plenty of ways to slap a label on it, tape it up, and drop it off and never answer any questions about what’s in it besides “is it hazardous”.
However the “we don’t ship cash” is listed[1] alongside “you are not allowed to send flammable or explosive material” so some workers might think that similar federal rules make both illegal. But one is “just” policy while the other is policy based on legal requirements.
They might be talking about mailing cash internationally, which does require you to disclose it on a customs form, but it’s also not illegal.
Is this article a true story? It is completely legal to send cash in the mail (the US mail, at least). I can't imagine it would be illegal to send cash by UPS, either, even if the carrier does not allow it:
https://www.snopes.com/fact-check/sending-cash-u-s-mail-ille...
The story was certainly heartwarming but this lack of fact-checking makes me question everything in the piece.