If a person was devout in their religion, then supposedly their morals should prevent them from lying. But the purpose of the oath is to declare in front of the court that the testimony you are providing is the truth. If it is found that you are lying, then you may be held accountable for perjury and may face charges. The words may not have any meaning to liars, but it does have some purpose.
Then why have a bible in the room and the words "so help me god" in the oath?
Wouldn't "Do you swear that the testimony you are about to give is the truth, the whole truth, and nothing but the truth?" accomplish the same thing?