We can get into a chicken-and-egg sort of argument about whether choosing an idol instead of the one true God leads to immorality (which it does, because all other moral systems are necessarily inferior), or whether it’s the selfish pursuit of desire that leads inevitably to an idolatrous pathway that will permit it (which is also true, as Israel proved in the wilderness).
Let’s just say that however it may begin, immorality and idolatry have a tendency to create the spiritual equivalent of a perpetual motion machine. One feeds the other.