In this case, wearing the tiny hat is a symbol of respect to the god they worship (I'm an atheist myself, no hate intented). So if you want to enter, I think it's perfectly reasonable that you wear it, not to respect the god, but to respect the people who worship him.
However if you don't...