It is not strictly necessary that all these rights should go to the same person, neither it is necessary that such rights have to be related to marriage. It is simpler that way, but it does not seem to be strictly necessary. For example, a person could designate another person (whom they trust and who doesn’t have to be their spouse, e.g. it could be a sibling, a parent, or simply a friend they respect) to make medical decisions in such cases and that would be analogous to a testator being able to name an executor of his/her will. If in a similar way other legal things that are currently associated with marriage were decoupled from it and each such right or duty would go to a designated person (not necessarily the same in all cases), marriage wouldn’t require any government involvement.
It is not strictly necessary that all these rights should go to the same person, neither it is necessary that such rights have to be related to marriage. It is simpler that way, but it does not seem to be strictly necessary. For example, a person could designate another person (whom they trust and who doesn’t have to be their spouse, e.g. it could be a sibling, a parent, or simply a friend they respect) to make medical decisions in such cases and that would be analogous to a testator being able to name an executor of his/her will. If in a similar way other legal things that are currently associated with marriage were decoupled from it and each such right or duty would go to a designated person (not necessarily the same in all cases), marriage wouldn’t require any government involvement.