It’s part of the Blizzard-provided API. They only care if you automate spells / combat for the most part. Sorry, this feature isn’t going away or it would have many many years ago. They would break the part of the API that allows this if they didn’t want it happening in the game, as it’s nothing even close to being new in this day and age.
If you want a further explanation, skip to about post number 4 where someone who writes code related to doing this chimes in
Not all automation is against the TOS. I frequently automate selling multiple things in my bags, disenchanting, and prospecting in retail. All without issues for about 10 years.