This does not answer your question specifically, but as it's been around for two days now, how about the following?
Removing one's hat has long been a sign of respect, probably dating back at least to the days of chivalry when a knight might well remove his helmet to show friendly intentions.
As for the phrase "Hats off to...!" - which is close to what your question is all about - that has been around only since the 1920s, as a sort of order to show that respect.
You see it in such sentences as: 'Hats off to the Irish rugby team!'...'Hats off to the Black Watch!'...and so on. Strangely enough, the very earliest recorded version, which appeared in 'The Daily Mail' in 1923, said: "Hats off to France!"