The cosmetic items from loot boxes (as well as those attained from normal play) can then be sold in online markets (such as scrap.tf or marketplace.tf) for real-world currency.
This is probably what the primary goal of the bots is. Ironically, the source of TF2's profit for Valve (microtransactions for cosmetics) is also a partial cause for the bot crisis.
Many people enjoy feeling superior to others, and have zero qualms about behaving immorally or against the rules. Some even get off on it and enjoy the challenge.
We see this behavior everywhere in real life as well, but it's much easier to achieve in a virtual setting. Whether that's by harassing someone verbally, or winning in a game by cheating, it triggers the same pleasure receptors for these people.
A psychologist could explain this better, and I'm sure this has been studied thoroughly.
I don't think I'd waste my time on something like that today, though.
While I lost interest after leveling up a few characters over night and letting the bot farm, my friend kept on working on them to make them better and sell them for little money. After all we were still in school and he made some good money with it. I'd assume that's the point for most cheat devs. Just doing it to show it could be done. Those people that annoyingly use the bots are just laughing their asses off while using them. Schadenfreude is a thing, you know?
In gaming, cheating is an opportunity to LARP as a better player. Gaming identities are often anonymous, cheat tools are widely available, and the prevalence of anti-cheat implies that “lots of other people are doing it” which gives some personality types sufficient moral cover.