Wearing Shorts (or Revealing Awrah) In Private
As per Quran, we are required to hide our private parts and parts annexed to private parts in the presence of other people. Exposing our private parts in front of others fall in the definition of “ Fawahish ” which is a sin. None of this applies when one is alone or with wife. This Hadith is also pointing to this fact to not expose private parts in front of others except for wife. The last part of the Hadith is not a ruling or an injunction, rather a way to encourage modesty. Since modesty is not something which can be switched on and off anytime, rather it is something which starts as an innate feeling and is affected by the person’s environment and sensitivity towards it. Therefore, the more a person stays sensitive towards it, even alone, the more modest a person can stay in real life scenarios. However, there is no prohibition of this sort when one is alone. And as pointed by Faisal Sahab above, there is no such issue when it comes to wearing shorts when one is alone.