A little background. The Mishna in כתובות is discussing aveiros that the wife does that cause her to lose her כתובה. The Mishna firsts lists dinim d'oraysa (the Mishna calls them דת משה) and then dinim d'rabbanan (the mishna calls them דת יהודית). One of the things that the Mishna lists as דת יהודית is יוצאת וראשה פרוע, meaning she gets out with her head uncovered.
Belows is the gemara that discusses יוצאת וראשה פרוע:
Here is my rough translation (including some basic comments) of the gemara.
The gemara asks, isn't יוצאת וראשה פרוע (going out with her head uncovered) d'oraysa? We learn out from the pasuk (by Sotah) ופרע את ראש האשה, that we expose the head of the women, that from here is a warning that Jewish women should not go around וראשה פרוע , with their heads uncovered. The gemara answers, min hatorah קלתה (there is a machlokes how to translate this so I will leave it for now) is enough, דת יהודית adds on that קלתה is not enough. R' Asi says in the name of R' Yochanan that קלתה is not considered ראשה פרוע, her head uncovered. R' Zeira asks what is the case? If it is in the market then she is violating דת יהודית, and if it is in a חצר (private courtyard), no woman will be able to stay married. Abaye or some say R' Kahane answered, R' Yochanan was talking about the case where she is going from private courtyard to an other private courtyard through a מבוי (which is semi-private)
Now I would like to analyze the Gemara.
1. We need to understand what does the Gemara mean when it says that יוצאת וראשה פרוע (going out with her head uncovered) is d'oraysa. Is this to be taken literally? This is actually a machlokes harishonim. The Meiri writes that this is a real din d'oraysa. However, the Terumas Hadeshen writes that this is only an asmachta. The language the Gemara uses is sometimes used by dinim d'rabbanan. The overhwelming majority of modern day poskim hold that it is d'oraysa. Here is a partial list: Mishna Berura Siman 75, Yechavah Daat 5:62, Tzitz Eliezer 7:48:3, Iggrot Moshe EH 1:53, Seredai Aish 3:30
2. Who does this halacha apply to? The Rambam איסורי ביאה כ"א,י"ז seems to apply this to unmarried women as well. The Shulchan Aruch in Even Haezer Siman 21 also seems to apply this to unmarried women. The Gra' there comments that the source is that the Gemara states אזהרה לבנות ישראל the term bnos yirael implies all Jewish girls/women. If it had been just married women it should have said אזהרה לאשת איש instead. However, the mefarshim on the Shulchan Aruch point out that in אורח חיים סימן ע"ה the Shulchan Aruch does distinguish (with regards to saying Kris Shma next to uncovered hair) between married and unmarried women. Therefore they suggest that in Even Haezer the Shulchan Aruch is referring to divorcees and/or widows, but never been married girls do not need to cover their hair.
3. What does קלתה mean? Rashi, Tosafos, Ritva and others understand it as follows. It is a head covering like a basket which has holes in it and you can see some of her hair through the holes. According to this what is the דת משה and what is the דת יהודית? The דת משה is to cover a majority of her hair (see Igros Moshe Even Haezer siman 58 for the derivation), the דת יהודית is to cover all of the hair.
4. What was R' Zeira's question? According to many Rishonim (Rashi, Tosafos, Ritva, Ran), the question was as follows. How can we require any head covering whatsoever in a חצר, it is too much for the women to handle. The Gemara's answer was you are right, in a חצר there is no chiyuv whatsoever to cover her hair. When she is going from one to another through a מבוי then she needs to cover a majority of her hair.
When we say that in a חצר there is no chiyuv to cover her hair, what is the reason? Does this apply even if there are other people around? Both Rashi and the Ritva understand the heter of חצר as follows. Since it is a private place no one will see her. Based on this, if there are other people around she would need to cover her hair. However, the שרידי אש assumes that the heter of חצר applies even if other people are around. It would seem that he learns that the heter is based on the place. In a private place the woman is allowed to act in a more informal manner. This שרידי אש is the basis for those women who cover their hair out of their house but not in their house. The overwhelming majority of poskim reject the שרידי אש and hold that the heter of חצר only applies if no one is there. Furthermore, they quote the gemara in Yoma 47a which has a midas chassidus that a woman should always cover her hair even in private.
The Rambam has a different understanding of the Gemara. The Rambam holds that קלתה means 1 covering like a kerchief. In other words, דת משה is to wear 1 covering which covers all her hair, דת יהודית is to wear a second covering. This is the source of the minhag among certain chassidic groups to wear a shaitel and on top a hat.
The דת משה (which may or may not be d'oraysa) is to cover a majority of her hair when she is in public. The דת יהודית adds on that in public she needs to cover all of her hair. In private (חצר or house), if no one else is around there is no chiyuv at all according to many Rishonim, if others are around, according to most poskim there would be a chiyuv to cover all her hair, according to a minority opinion there would be no chiyuv.
I have seen a piece written by Rabbi Broyde where he claims that דת יהודית depends on the time and place and therefore it would change based on society. Based on this he claims that in a society where women do not cover their hair it may be permitted for Jewish women as well (he writes this as a limud zechus).
I don't understand however, what he does with the din d'oraysa (or asmachta) that the Gemara learns out from Sotah? This din which is learned out from a pasuk (even if it is an asmachta) is not going to change based on the minhag. The Gemara clearly states that יוצאת וראשה פרוע is learned out from a pasuk. While there may be a machlokes what exactly this means the bottom line is that there is some form of head covering that is required by ths limud from the pasuk. This will not change based on society and therefore I don't see what the basis for the heter to not cover hair at all is.