Not all optimisation in software engineering has been about resource efficiency
There are other concerns that the commissioners of software have long been concerned about need to be considered yet it's fashionable amongst us older devs to pretend that back in my day, we had to lick t' road clean before fatha would even let us go to school and we made every byte count, etc. etc.
The problem is if you cast your mind back to software development in the 70s and 80s and even 90s ... it was fucking awful. The tools were primitive. There wasn't a lot in the way of useful abstraction, which means stuff took ages to develop, was usually fragile and tied to specific bits of hardware, and riddled with the sorts of potential security bugs that would have you hung by the foreskin until sorry for in modern day computing (but fortunately back then everything was air-gapped).
Not only did stuff take ages to develop, it didn't actually do anything much that everyone takes for granted these days. Software almost certainly wouldn't have worked with any other character set than US ASCII. It wouldn't have handled RTL script. It very likely didn't have any undo feature, or any cut and paste or global clipboard. Your fonts would have been shitty bitmaps on a low-res monochrome screen instead of beautifully rendered glyphs in 32 bit colour rendered slightly larger on your 4K monitor for your tired miserable old eyes. It might not, if you go far enough back, even have had a GUI. It won't have been able to even access more than 2GB of RAM until it got a 64 bit OS. It would likely have just crashed when it ran out of physical memory. All of these things have been added and demonstrably made using software vastly better than it used to be... and it's all cost space. Everything's come at a cost in space, and CPU power.
And while it was taking ages to develop, very few people had much of the required patience and autistic attention to detail to actually do it properly, and so they commanded a very high price, which they charged for a very long time, and this vexes people who pay for these things to get developed, so they're very keen to make it a) easier and therefore less of an exclusive and hence expensive club and b) quicker so it costs even less to make and gets to market faster. And these two last drivers of market forces are the full force of what's driven software development for the last ... 3 decades or so? Make it quicker. Make it cheaper.
It's still vastly cheaper to buy RAM than it is to optimise software. Vastly, vastly, cheaper. Even at todays slightly higher prices. And ... I'm fine with that, because I can concentrate on the first, and most difficult bit of software development - make it work - for longer before I have to worry about the next bit - making it fast.