I have often heard that one should not wear shorts while davening. This makes intuitive sense to me that we should do this out of respect. But is there any halachic reasoning behind this? Is it absolutely forbidden to wear shorts while davening, or is this just something that is nice to do?
My Rabbi pointed out to me a prohibition on wearing shorts in synagogue, in a book on halacha.
I don't recall if it mentioned the following, which I've heard. In the case of kibbutzim, where anyways people are wearing shorts as they work outside in the fields, and they weren't required to go home to change before praying; even the shaliach tzibur could wear shorts.
On another occasion, I saw a friendly acquaintance wearing shorts in synagogue and mentioned that I'd been told it wasn't allowed, so he might want to check with his rabbi as to what to do. He responded by saying that it's short shorts that are prohibited, but his were knee-lengths and his rabbi said it was OK albeit not preferable in the first place.
Also: I thought about the "before the King" analogy and have the following issue with it. We're also "before the King" when we go anywhere, because He Is everywhere. So by that reasoning you couldn't wear shorts ever, and yet we find that there's an obligation to teach one's kids to swim, which obviously requires wearing shorts. If you were to respond by differentiating between a synagogue as being especially holy, that's a good point but I don't think it fully answers the issue. It's like someone who pointed out that men don't need to shower 3x/day just because they pray 3x/day.
Emotionally I'd like to be able to wear shorts in synagogue, intellectually I feel the holiness of the place bars that possibility. Don't test me for intellectual honesty :P
See Mishna Brurah 91:13 it seems that in very hot places it might be permitted.I believe later achronim discuss this.
Interpreting from Mishna Berura in 2:1 , Irrespective of davening You should never wear any clothing which does not extend beyond your knees. The shape of your body also should not be discernible to the onlookers. Ideally all coverable parts of your body should be covered at all times not just davening.
there is a principle that things which can be derived from reason via "kal v'chomer" (major to minor logical inference) are obligatory even if they are not explicitly written in the torah.
The Talmud in Pesachim 75b discusses the prohibition of bringing coals which make too much smoke for the incense offering. There it says: "For that you don't need a verse, [to prohibit it] since before a flesh and blood king, one would not do this, how much more so before the King of kings, the Holy One blessed be He."
Hence, the torah does not write things which one can derive from reason even though they are obligatory. Just like it doesn't say anywhere that you can't daven while holding a cat.
So, to answer the question, under normal circumstances and for someone with some degree of intelligence as to Who he is praying to, it would seem to be forbidden by the above kal v'chomer.