Yes, “for” as “because” is mostly just used in literature, and maybe very formal speaking, but in casual speech it isn’t used much. I think it is good to understand it, though, because it is used in writing a lot.
'For" being interchangeable with “because of” in miriaml5’s example is more common.
As nashlam said, “for” has kind of a close meaning anyway.
The most common phrase I can think of “for” being used before a reason in spoken, casual English, is “for the fun of it.”.
A: “Why did you do that?”
B: “For the fun of it.”
“I just ran for the fun of it.”
Etc.
You might also hear,
“For the hell of it.” Which just means, “I don’t really have a reason, but I wanted to do it.”
*Note: hell is sometimes considered a swear word, so don’t use this in formal speech, at work, etc.
Example:
A: “Why did you do that?”
B: “For the hell of it.”
A: “Why did you do that?”
B: “Why not?”
A: “Why did you do that?”
B: “Just because.”
They all can kind of mean, “because I wanted to do it.”
You can say:
“I exercise for my mental health.”
“I exercise because it improves my mental health.”.
I exercise because my mental health is not good otherwise.
You cannot say:
“I exercise because my mental health.”. It isn’t a complete thought.
If you say, “I exercise because of my mental health,” it sounds better, but still kind of unnatural.