Bruce Winter has done some really great work with 1 Corinthians. If you randomly grab 12 commentaries on 1 Corinthians written in the past 20 years, you'll probably see Winter in the footnotes of virtually all of them.
His book After Paul Left Corinth: The Influence of Secular Ethics and Social Change is so helpful. (Unfortunately, it's not very accessible to the general reader. The author assumes the reader knows a fair bit already, including the Greek language.)
In that book, Winter argues that the head covering commands have to do with social norms in the Roman world. Pagan Roman priests would often cover their heads while presiding over religious rituals. Apparently, some men in the Corinthian church were doing the same while praying or prophesying, thereby trying to convey their high social status. Paul wants none of that.
In the Roman world, for a woman to cover her head was to convey sexual unavailability. Preachers have sometimes compared this to a wedding ring, which is not a bad analogy. Apparently, some married women in the Corinthian church were deliberately uncovering their heads prior to praying or prophesying. (Their motivation for doing so isn't super obvious, but Winter argues that it might also be a social status thing, for reasons I won't get into.) This would have conveyed all sorts of wrong messages about the nature of Christian marriage, so Paul wanted none of that.
Note well: The command for men to be uncovered and married women to be covered while praying or prophesying has to do with symbolism that would have been readily understood in a Roman city like first century Corinth. But it has little meaning to us today. This is why Christians today (rightly!) do not insist on these head covering rules.