Sorry to hear you got caught for €500. As others have said it is illegal to tow a car in Spain.
I would suggest that the police were a bit short of some cash for lunch. My wife was picked out a line of traffic pulling onto a roundabout at round 15kmh. They said she was doing 40. She was the only UK car in the line.
I hope you got a receipt. Be warned, the fuzz here are not all honest.