How is an HR person writing a script to do their HR work better considered an R&D expense?
Scripted automation is quite literally development of IP. It's an asset that belongs to the company and will be counted as such on its balance sheet.
What if they literally just write a post-it note of how to perform certain actions? Are those 5 minutes capital investment? The information on that scrap of paper is subject to copyright and is a company asset in just the same way as a script. Where do they draw the line?
Anytime someone has a good idea, it should be depreciated over 5 years? Why is software special? It is all just the composition of simple machines.
I'm pretty sure it's because other industries wondered why they were having to spread such costs over 5 years while software firms were able to write them all down at once. It's not that I have a strong opinion about this either way (I'm not running or employed in a business where this matters), but that ultimately this is a philosophical argument. There isn't an objectively correct way to do this, how you view it is down to what your economic interests happen to be.
It's the other way around. Software used to be special, in that money the company spent to improve its internal processes by, say, buying a calculator had to be amortized, while money spent on developing software automation were not.