This was a situation that could have been avoided if the OP had gotten himself informed of the rules ahead of time.
If he had asked on this forum or checked the published regulations, if
Can I enter Canada with pepper spray?
Can I enter Canada with someone else's prescription drugs?
Can I enter Canada with a friend that has a criminal record?
The answer would have been a resounding NO, you can not do any of these.
The time to ask is before, not after. In this Information Age we now live in, keeping one's self informed is not too difficult, IMHO.
As they say, talk is cheap, until you hire an attorney to represent you, as the friend would have had to do to gain entry into Canada. Not hard at all for me to see how $3000 could be spent on the legal process.