They did not spray them to punish. They sprayed them to force them to move.
How do you "remove" a crowd that has you outnumbered? How would you have done it?
You move in to arrest. If the crowd moves in, you spray them to protect your life. You don’t spray people sitting on the sidewalk in anticipation of something maybe happening.