I certainly do not agree with this quote of Shakespeare (I don’t know where he has said that, as I couldn’t find it). I, however, can make a guess as to why he might have written it, and in what context.
Let’s talk about prostitution first. The model of prostitution works on the idea of paying for sex on demand and a few other services related to sexual intercourse and pleasure. These include ***** tease, lap dance, and a lot of other unmentionable and inappropriate things. And in the most of the countries all this is illegal.
Now let’s come to the institution which is not just legalized, but holds an immense importance in any country. Some people even think of marriage as the way of getting legitimized sex, as pre-marital sex even with the consent of both the partners is considered to be a taboo in many countries like India.
Do you see any meeting point between prostitution and marriage? Well, I don’t see any immediate one. Just one, which is quite remote and might be true in only some cases.
If we take into regard the institution of patriarchy, we can say that men think their wives as someone who is supposed to present them with literally anything they demand for. Marriage, legally, goes even beyond sex-on-demand and includes a lot of things which wife has to do for her husband just because the husband is a bread earner and provides her with all the basic necessities.
Although modern era has seen the collapse of this patriarchal structure and now women are contributing equally to the finances of their households, in Shakespearean era it was not so and marriages of convenience were quite popular. So in light of that era’s historical background, it could be true, but is not very much relevant these days.