It is allegorical in that the punishment isn’t going to happen.
Your honor to keep secrets is the point of the oath.
That is, there really isn’t anything secret within masonry. It is all there on the internet.
However, a thing that should be kept secret should be kept secret.
For instance, a friend shares some information of a personal nature and requests you keep it between each other or you really should know it was private.
You may, for instance, have the idea someone else may be able to help and want to share that person with your friend and explain the problem.
You should not violate your integrity and bring that other person into the knowledge that was shared, unless you speak with your friend and he agrees.
Otherwise you will demonstrate you are not to be trusted.
Same with money or anything else with a lodge or brothers, etc.
Keep yer maw shut.
That’s the whole secret
This is grown men taking these oaths, which,BTW, Jesus told us not to take.
Matthew 5:33-37 Again you have heard that it was said to those of old, You shall not swear falsely, but shall perform to the Lord what you have sworn. But I say to you, Do not take an oath at all, either by heaven, for it is the throne of God, or by the earth, for it is his footstool, or by Jerusalem, for it is the city of the great King. And do not take an oath by your head, for you cannot make one hair white or black. Let what you say be simply Yes or No; anything more than this comes from evil.