The best explanation is probably that the possibility of same-sex marriages were not on the author's mind when he/she came up with the exercise.
If we suppose that marriages is always between a man and a woman (and genders are binary, bla bla bla), then the relation is indeed transitive, but vacuously so.
The condition it has to satisfy is that if $x$ is the wife of $y$ and $y$ is the wife of $z$, then $x$ is the wife of $z$. However this is true because the premise (i.e. the part after "if") is impossible to satisfy (under our assumed assumptions): $x$ can only be the wife of $y$ if $y$ is a man, and $y$ can only be the wife of $z$ if $y$ is a woman. Since nothing is both a man and a woman, both of these cannot be true at the same time.
In other words, the only way for a relation not to be transitive is if there is some $x$, $y$, and $z$ such that $xRy$ and $yRz$ and not $xRz$. If there is no such example, the relation is transitive -- no matter why there is no example.
Thus, the relation is transitive for the same reason that the empty relation is transitive: Because there are no triples $(x,y,z)$ such that $xRy$ and $yRz$, the condition for being transitive is not automatically met.
On the other hand, if $R$ includes information about at least one lesbian marriage, then it fails to be transitive: Suppose Alice and Betty are married. Then, in the case $(x,y,z)=(\mathit{Alice},\mathit{Betty},\mathit{Alice})$ we have that $\mathit{Alice}\mathrel{R}\mathit{Betty}$ and $\mathit{Betty}\mathrel{R}\mathit{Alice}$, yet not $\mathit{Alice}\mathrel{R}\mathit{Alice}$, since Alice is not her own wife.