It’s traditional English and US common law, based on the old assumption that men owned both their wives and their children, and were thus responsible for controlling what their wives did.
Obviously these assumptions no long apply.
English common law was based on the best tools available at the time, including the "Solomon-like" decision to assume the husband is the father absent clear and convincing evidence to the contrary. If the wife was proven to be adulterous, both the woman and her bastard were banned to fend for themselves.
DNA changed all that...
This British law you speak of goes back a millennium, if not more. The notion being that if/when a woman inherited property (no Salic Law in England) she could not physically defend it against the Picts, Saxons, Danes, Celts, Normans, etc. That took a man. Thus when a woman married all her property was surrendered to her husband*. This hopelessly antiquated law -- which may have made sense a thousand years ago -- wasn't repealed till the late 19th cen.
(*And yes, history records more than one woman thrown out of what was now her husband's house/lands.)