I think I can answer your question. We don't use our logical thinking capacity for much decision making. Most of these decisions are forced on us by external factors, often social/experience.

For example, shoplifting - I would never shoplift even if the opportunity was there. Not for immediate moral reasons, but because the option wouldn't even be available to me. Have you ever done that negative rationalisation where you think "that situation was bizarre, I could have just walked out with that stuff" but you didn't because that was never presented as a viable option by your mind. We've had how to act drilled into us, we don't think about it. I've got kids, I remember taking them to the shops, saying "now put it up on the counter, here's the money to pay with" subconsciously teaching them this exact interaction.

It would take pre-thought or circumstance to force the shoplifting option to be available. Maybe you witnessed someone close to you doing it as a kid, or you found yourself in economic strife, or you sat at home and thought it would give you a real thrill. Something forces the option, you do it get get away with it, now that option is there. Next time you're at the store you might shoplift again even if you have moral objections to the idea. Now you've pretty much set yourself up, you have to rationalise it one way or another. And you probably don't even understand why you did it, so your brain is going to make something up.

This just played out in the country where I live, a politician was caught shoplifting from designer clothes stores. There you have a person with a very high wage who does not need to do it for economic reasons, where the consequences were severe. I very much doubt this person thought beforehand, because then they wouldn't have done it.

So this rationalization is a side effect. Pressure is to have larger brains for intelligence, I'm not up to date with the currently thought reasons for that pressure but it was all about social interaction etc. last I knew. However, thinking is quite expensive and we don't really do it much. Rather, most of the time we use our standard operating manual written by experience and social structure. If we then, later, try to consider our actions, we run round in circles trying to explain the unexplainable.

Your other examples fit this. Torrenting, that's a pretty social structure thing. I don't think my kids would even think of it right now, because they've had no exposure to it as a thing. Whereas I was a teenager when pirating music and software was huge, it's just second nature to look for torrents even when I could just buy... glad of spotify/netflix for removing enough friction on that front.

Climate change is a bigger one. We all grew up in a society where you drive cars. Expecting the average person to change their behaviour from the social norm is unrealistic. I've got a lot of climate related anxiety and I think we're well and truly fucked. To make myself feel a little better I try to think of humanity as evolved systems, not particularly intelligent once you get above the individual level. There's an abundance of energy resources and so evolutionary processes have eventuated to consume it, that being ourselves. There are people to blame of course, those in power who said they believe in it (rather than the denialists because why would they do anything?) and then did nothing or less than nothing and made it worse.