Q. Am I correct in thinking that marriages were originally recognized by governments for taxation purposes?
In the United States, at least, state governments began to recognise marriages because people wanted that transaction to be publicaly acknowledged in the broadest, most permanent way possible.
In early U.S. history, people would merely stand in a public church or town meeting hall, or on the town square, and take vows to keep an exclusive union. The purpose of the publicity was to put everyone else on notice that those two people were 'taken', so to speak. Then people decided that official recording of such things as land transfers, deaths, births, and marriages, would be a benefit as it would provide an unimpeachable and permanent memorialisation of the transaction. In effect, the state became a witness to the transaction, and the actual human witnesses were just agents for the legal fiction that we call the state.
In order to be able to do its job in this respect, the state legislatures needed to define exactly what the word 'marriage' meant. And so now we have a definition of what can constitute a marriage for legal, public recording purposes, to-wit, otherwise unmarried, older than a minimum age, of different gender, and not kin ... and monogamy-only, of course.
Special benefits or detriments, like taxation, are merely secondary phenomena that have occurred over time.
Though the idea behind making the state a legal witness was probably well-intended, the result has been a substitution of Elohim (God) for the state. Over the years the state, both in the USA and elsewhere, have redefined marriage, taking it out of its Christian/Messianic context. It is my personal view that as far as marriage is concerned, the State should mind its own business. If they feel that they want to, the couple may enter into a legal arrangement for the settlement of economic matters upon the death of one of the parties.