We have laws that send people who murder to jail. I don't think you'd argue the main reason you don't murder people is to avoid jail.
Consequences existing does not mean the only or even primary motivation is to avoid the consequence.
Consequences existing does not mean the only or even primary motivation is to avoid the consequence.