Nearly every society will develop its own code of ethics and survival guidelines. Religion exists as a way of passing down the code of ethics. The Bible has passages in it for when you're angry and need to calm down, it has passages for when you're grieving, it has passages for when you need to get aggressive and fight, it has passages for when you're feeling lost in life.
The end goal of religious texts is to have a guideline people can turn to when they need direction and a way of creating a unified narrative that people in the society can use to keep themselves safe. The central core of all religions is the preservation of the community of believers.
Where people go wrong is that they start interpreting the texts in ways that justify what they were just going to do anyway. It's how you have people like Joel Osteen or that demonic looking cac preacher that have all sorts of things to say about being blessed with wealth but then it's

on the passages about giving away wealth and living a simple lifestyle.