Iran isn’t a perfect nation however you have to look at their history as to why they have the mindset they have right now concerning the West. Iran’s foreign policy is defensive in nature.
Now when you are surrounded by your arch enemy like this. And they have advanced weapons plus their vassal states have advanced weapons it creates a siege mentality in your head. This is why Iran’s whole strategy is developing ballistic missiles, creating proxies in surrounding nations and being masters of asymmetrical warfare to make the cost of war too high. If a nation was surrounded by military bases of a hostile foreign power that repeatedly says they want to invade you. You probably would do what Iran is doing now.