Halacha prohibits causing pain to animals. There is a Talmudic discussion as to whether this prohibition stems from Torah or is Rabbinic in origin. (B.M. 32) The consensus of Poskim is that the prohibition is of Torah origin.
There are a number of suggestions as to the Biblical source. Indeed, two of the Medieval giants derive it from Parshat Balak. Bilam is chastised, “Why have you beaten your donkey?” (Numbers 22:32)
Rambam (M.N. 3:17) emphasizes that this Mitzvah trains us to refrain from cruelty. Sefer Chasidim (666) points out that Bilam’s demise, by sword, is connected to his threatening the donkey “If I had a sword in my hand, I would kill you.”
Causing pain to animals is wrong. How much more so not to be the cause of anguish to others.
Shabbat Shalom