Yes. Any type of hidden weapon (i.e. in a purse or glove compartment), including pepper spray, mace or similar product is a prohibited weapon in Canada and is subject to confiscation. That is why it was taken from you and I believe that the form you signed was that you wished to voluntarily surrender it, since you did not do it knowingly. Otherwise, you technically could have been denied entry or even charged with a criminal offence, but that is rarely done unless the spray has actually been used against another person.
The only time you can legally be carrying any type of pepper spray is if you are travelling outdoors in places where there may be bears or other dangerous animals. In those locations it is sold in large canisters, clearly marked as bear spray, that cannot easily be concealed in a purse or elsewhere. To have it in your possession in most other circumstances can lead to charges and if you actually use it against a person, you will face criminal charges here. There are similar regulations in the UK, Australia, New Zealand and many western European countries.
This is what I mean by Americans needing to read up on what is considered a weapon in Canada before showing up at the border. Without getting political here, we have a very different attitude about people being armed with any type of potentially damaging or lethal weapon, even for self-defence, especially where the potential weapon can be concealed. If you have ever talked to anyone sprayed with pepper spray, you might then understand why that type of thing is on a prohibited list here.
I know several police and military personnel who have sometimes been exposed to it as part of their training, so they know how to deal with it if it happens to them. They all found it to be a debilitating experience, even if you have mostly recovered in an hour or so. And you definitely have the right to disagree, but it is a moot point once you cross the border into our country.