Why sex is forbidden in islam before marriage?

No Sex Outside Marriage

Everything is composed of small units, just like a house is built with bricks. Likewise, society consists of multiples of a small unit which is the family a man and a woman are united by a bond to form a complete unit.

Despite its dislike of divorce, Islam permits it as a necessary remedy when things go wrong it encourages the preservation of the family because it is the most important institution in human society.