Arturo, "to use in vain" has nothing to do with "vanity" in this context.
To do something "in vain" means it is pointless, has no gain.
To use "the lord's nane in vain" comes from Exodus 20:7 which reads: "Thou shalt not take the name of the LORD thy God in vain; for the LORD will not hold him guiltless that taketh his name in vain." (KJV). It was a mortal sin once but produced euphemisms like "gadzooks" and"odds bodikins" in the Middle Ages to allow "coded" swearing using god's name. "Gee(willikers/whiz/pers)" are, along with those mentioned before, modern examples of displacing the blasphemy. Oh, and add "golly" and "gosh" to the list.
But for an athiest to say, "Oh, God" is like both above, pointless except as an expletive to express feeling and be offensive to theists. Of course, the atheist might just have a sloppy language habit or be wishing to provoke, or just be casually nasty, to theists.