The basic principle is that zina is a greater sin than gambling and drinking alcohol
The texts of the Qur'aan and Sunnah indicate that zina, alcohol and gambling are major sins. Allah says (interpretation of the meaning):
“O you who believe! Intoxicants (all kinds of alcoholic drinks), and gambling, and Al‑Ansaab (stone altars for sacrifices to idols etc) and Al‑Azlaam (arrows for seeking luck or decision) are an abomination of Shaytaan’s (Satan’s) handiwork. So avoid (strictly all) that (abomination) in order that you may be successful”
“And come not near to unlawful sex. Verily, it is a Faahishah (i.e. anything that transgresses its limits: a great sin), and an evil way that leads one to hell unless Allaah forgives him”
Al-Bukhaari narrated from Abu Hurayrah (may Allah be pleased with him) that the Prophet (blessings and peace of Allah be upon him) said: “No adulterer is a believer at the time when he is committing adultery; no thief is a believer at the time when he is stealing; no drinker of wine is a believer at the time when he is drinking it.” Narrated by al-Bukhaari (5578) and Muslim (57).
Allah has made avoiding these evil deeds a condition of expiation of bad deeds and rising in status. Allah says (interpretation of the meaning):
“If you avoid the great sinswhich you are forbidden to do, We shall expiate from you your (small) sins, and admit you to a Noble Entrance (i.e. Paradise)”
It was narrated from Abu Hurayrah that the Messenger of Allah (blessings and peace of Allah be upon him) used to say: “The five daily prayers, from one Jumu’ah to the next, and from one Ramadaan to the next, are an expiation for whatever (sins) come in between, so long as one avoids major sins.” Narrated by Muslim (233).
The most serious of these three major sins is zina, because Allah mentioned it alongside worshipping idols and murder. Allah says (interpretation of the meaning):
“And those who invoke not any other ilaah (god) along with Allaah, nor kill such person as Allaah has forbidden, except for just cause, nor commit illegal sexual intercourse”
And because, in addition to its being a major sin and transgression against the rights of Allah, it is also a transgression against the dearest and noblest thing that a person can possess, which is his honour, in addition to the serious negative consequences, evils and shame that result from it, which may last for a long time and affect generation after generation -- Allah forbid.
Al-Mundhiri (may Allah have mercy on him) said:
It is true that when the one who persisted in drinking alcohol dies, he will meet Allah like one who worshipped idols, and there is no doubt that zina is worse and more serious before Allah than drinking alcohol. End quote.
Al-Targheeb wa’l-Tarheeb, 3/190.
Al-Safaareeni (may Allah have mercy on him) said:
Zina is the most serious of major sins after shirk and murder. End quote.
Ghidha’ al-Albaab, 2/305
Hence the hadd punishment for zina is more severe than that for drinking alcohol, especially if the person is married.
And drinking alcohol is worse than gambling. The Prophet (blessings and peace of Allah be upon him) cursed ten with regard to alcohol: the one who squeezes it (the grapes etc), the one for whom it is squeezed, the one who drinks it, the one who carries it, the one to whom it is carried, the one who pours it, the one who sells it, the one who consumes its price, the one who buys it and the one for whom it is bought.” Narrated by al-Tirmidhi, 1259; classed as saheeh by al-Albaani.
It leads to all evil and bad attitudes, and it is the mother of all evils.
But the matter may vary, according to the evils and corruption that result from it. A man may commit zina once and then never repeat it; a man may drink alcohol and become addicted to it, so his attitude becomes bad and he commits a lot of immoral deeds, forsakes his family and does not spend on his children; his love of alcohol may tempt him to steal and keep company with bad people, and other things that some of these people may fall into. So in that case, his situation is worse and his sin is greater than the one who commits zina once and then gives up zina.
Al-Nasaa’i (5666) narrated that ‘Uthmaan (may Allah be pleased with him) said: “Avoid alcohol for it is the mother of all evils. There was a man among the people who came before you who was a devoted worshipper. A seductive woman fell in love with him, and she sent her slave-woman to him to call him to bear witness. He went with the slave-woman, and every time they passed through a door, she locked it behind them, until he reached a beautiful woman with whom was a child and a vessel of wine. She said, ‘I did not call you to bear witness, rather I called you either to have intercourse with me, or to drink a cup of this wine, or to kill this child.’ He said, ‘Pour me some of this wine.’ So she poured him a cup, then he said, ‘Give me more,’ and he did not stop until he had has intercourse with her and killed the child. So avoid alcohol, for by Allaah faith and addiction to wine cannot be combined except soon one of them will be expelled.”
Classed as saheeh by al-Albaani in Saheeh al-Nasaa’i.
al-Saawi said in his commentary on al-Sharh al-Sagheer (4/500) about drinking alcohol:
Its evil consequences are worse than the evil consequences of zina because it is very common, because drinking it may lead to zina, stealing and murder, hence it was narrated that it is the mother of evils. End quote.
So the basic principle is that zina is the worst of the three, then alcohol, then gambling. But it may vary according to the evil consequences that result from it. What is required is to keep away from all of that and similar major sins and haraam actions. The one who has a problem with any of these evils at any time should conceal himself with the concealment of Allah and hasten to repent before it is too late and before a seal is placed on his heart as the result of continuing evil actions and sins.
Allah says -- after mentioning a number of major sins and immoral actions, such as associating others with Allah, murder, zina and other major sins (interpretation of the meaning):
“And those who invoke not any other ilaah (god) along with Allaah, nor kill such person as Allaah has forbidden, except for just cause, nor commit illegal sexual intercourse __and whoever does this shall receive the punishment.
69. The torment will be doubled to him on the Day of Resurrection, and he will abide therein in disgrace;
70. Except those who repent and believe (in Islamic Monotheism), and do righteous deeds; for those, Allaah will change their sins into good deeds, and Allaah is Oft‑Forgiving, Most Merciful
71. And whosoever repents and does righteous good deeds; then verily, he repents towards Allaah with true repentance”
And Allah knows best.