The Beit Shmuel was written by Rabbi Shmuel ben Uri Shraga Phoebus, a Polish rabbi, and was first published in 1689, with a much edited second edition in 1694. The work comments on Shulhan Arukh Even Ha'Ezer, and
אחת פנויה: היינו אלמנה או גרושה אבל בתולה מותר ופריעת הראש בחצר ליכא אסור אלא
משום צניעות ועיין ב"י וד"מ בסי' קט"ו ושם כתבתי בשם הסמ"ג והש"ג דאסור אפילו בחצר
"And also unmarried: This is a widow or a divorcee, but a virgin is permitted, and to go with an uncovered head in a courtyard is not forbidden except because of modesty... [ending with some citations, and a note that elsewhere, the author wrote that it was forbidden. I need to look into this part more.]
In the shiur I went to on college on the topic of women's head-covering, they brought this source- but only the first phrase. That makes the interpretation seem much simpler than the full length of the comment does, however short that may still be. Never-married women may go with an uncovered head, the end. But then the comment goes on, without actually designating another subject.
However, it then talks about courtyards (space that is not quite public, but also not quite private)- a subject that makes sense only for married women, if going about truly in public (the context stated in the Shulhan Arukh) is permitted for unmarried women. It makes no sense to require more covering in a less public place than in a more public one. So this must have to do with married women.
The question of modesty versus a marriage-related prohibition, which seems to be implied here, is rather confusing for me. If it is immodest for women to go with uncovered heads, then why do you need to require it separately for married women? I suppose this is an indication that mitzvot are one thing, and modesty, while also required, is so culturally influenced that you can't rely on it to stay steady. So perhaps head-covering is more than a modesty-requirement that gets waived for the unmarried. Or maybe not...
In summary- this comment raises more questions for me than it provides answers.