"You say they were in their right." I just said they were maybe within their rights. I still think it was an assholish move to do towards a foreigner not knowing the legal limitations. Again, you can buy self defensive spray, but some of them has to be labeled "against dogs".
But yeah, that is how it works in at least Northern Europe. All branches are giving a particular amount of money they are supposed to get through fines in a year. If they come up short, they will probably get really anal about these sorts of things. You obviously caught them (or they "caught" you) at a bad time.
The point is that this was not money for themselves to their own pocket, but rather just getting funds for the government. Still, it was not a very silly and anal thing to force money out of an ordinary civilian over something small like this.