I'm really sorry your trip got screwed up after probably months of planning. What an awful disappointment.
You haven't said much about your friend's response to this mess. Sounds like his background was what got the whole ball rolling. (When we entered Canada last year, it was nothing but friendly following the passport scan. No search, minimal questioning.)
Then the meds and pepper spray sealed the deal. Some of us have done dumb things, yes. We once put all our meds counted out in baggies (no original containers) for a long trip to Europe but luckily were never searched. Never made that mistake again.
But we all know we live in a different world than 15 years ago, and border crossing is serious, even though we think of Canada as our friendly buds up north. I'm putting myself in the place of the border guard who after an incident has to explain why he let the guy in the country who had three strikes.
The "shakedown" sounded more like - you can turn around or you can go see those supervisors regarding the fines for the drugs. Who knows, none of us reading the post was there. They didn't arrest you, so you had cost-free options.
Anyway, I wouldn't want to be in your friend's shoes after ruining my pal's vacation of a lifetime.