A lot of people swear their lives on it, while others can't stand it.
A lot of people swear their lives for it, while others can't stand it.
What's the difference between on and for in these sentences?
A lot of people swear their lives on it.
A lot of people swear their lives for it.
Neither of these sentences seems idiomatic. Nevertheless, we have the following phrasal verbs in use.
Swear on one's life/honor used for emphasizing strongly that you will do something or what you are telling is true (McMillan). For example, I swear on my life I will always remain faithful to you. Do you swear on you honor that you will never tell anyone (Longman).
Swear for used for giving assurance or to guarantee such as I swear for his safety.
As FumbleFingers said in the comment, if you swear on something, you are promising something. E.g., "I swear on a stack of Bibles, I am telling the truth," or "I swear upon my honor that I will pay you back tomorrow." However, "I swear my life on it" is a very unusual formulation. While it will probably be taken as "May I be struck dead (by a higher power) if I am lying," I would avoid using it. (Instead, consider, "I would stake my life on it.")
If you swear your life for something, it is still a somewhat odd construction, but would probably be taken to mean that you have taken an oath to defend, or fight for, someone, some country, or some cause, even if it means you die in doing so. It would seem archaic, like a knight swearing their life for the cause of their king. It would be more common to see "pledge" or "promise" used instead of "swear." (E.g., "I pledge my life and my sacred honor to the cause.")