Some sources
This hadith was mentioned in different hadith compilations it appears at least thrice in Sahih al-Bukhari (here, here and here), in Sahih Muslim and Sunan an-Nasa-i to name a few sources.
Dream-interpretation in the relevant context
Please be aware that dream-interpretation requires specific knowledge it is learnable or for some people a gift of Allah there are many posts on this site addressing this topic.
See for example:
How does dream interpretation distinguish itself from fortune telling?
What is the relationship between Ilham and leg of a bird?
What does the Quran and Sunnah say about telling one's dreams to someone else?
As to why clothes were related to religion or piety or (degree/level) of faith the most plausible relation and that, which all sources I've consulted referred to is the known verse from suart al-'Araaf:
O children of Adam, We have bestowed upon you clothing to conceal your private parts and as adornment. But the clothing of righteousness - that is best. That is from the signs of Allah that perhaps they will remember. (7:26)
Badr ad-Dyn al-'Ayni in his 'Ukmdat al-Qari عمدة القاري
pointed at a further meaning the shirt or cloth has the function of hiding the 'awrah from other peoples view. While the faith and religion etc. hides the 'awarh or the person from the punishment of the hell fire, here the quote:
In the following the I'll be translating from Arabic language, as these interpretations are of my own take them with the necessary care!
وَفِيه من التَّشْبِيه البليغ، وَهُوَ أَنه شبه الدّين بالقميص، وَوجه التَّشْبِيه السّتْر، وَذَلِكَ أَن الْقَمِيص يستر عَورَة الْإِنْسَان ويحجبه من وُقُوع النّظر عَلَيْهَا، فَكَذَلِك الدّين يستره من النَّار ويحجبه عَن كل مَكْرُوه، فالنبي صلى الله عَلَيْهِ وَسلم، إِنَّمَا أَوله الدّين بِهَذَا الِاعْتِبَار.
This (hadith) includes an eloquent example: it compares (or sets equal) the religion (piety) with the shirt (clothing). And the reason (or intersection) for this is the hiding. This is due to fact that shirts disclose the 'awrah of a hum and hid him form the sight. Similarly the religion (or faith) hides him from the hellfire, and all bad. This is the ulterior reason why the prophet Allah's prayers and blessings be upon him interpreted it as the religion (faith).
Analysis of the wording
Let's analyse the hadith from the perspective that the piety, faith or religion is referred to as the length of a clothing:
"While I was sleeping I saw (in a dream) some people wearing shirts of which some were reaching up to the breasts only
this is a reference to people who have some faith in them.
while others were even shorter than that.
This refers to people who are even less religious.
Umar bin Al-Khattab was shown wearing a shirt that he was dragging."
This means that 'Umar ibn al-Khattab was a very pious man. So the example of high level of faith or religion here is the length of the shirt. 'Umar was dragging his shirt because it was too long, as else he would stumble over it.
So this hadith is also showing the virtue of 'Umar ibn al-Khattab.
Additional information
Some scholars like ibn Hajar al-'Asqalani and al-Qustalani pointed at some variations of this narration that name the asking person:
The people asked, "How did you interpret it? (What is its interpretation) O Allah's Messenger (ﷺ)?"
and said it was abu Bakr, who is known from a different hadith to have knowledge and the gift of dream interpretation. Ibn 'Asakir however said it was 'Umar () himself, however the hadith as mentioned in the above sources is referring to a group meaning the sahabh ().