For twenty years after the establishment of the Order there was neither injunction nor rule concerning Pārājika and Saṁghadisesa offences. The members of the Order of the early days were all Ariyas, the least advanced of whom was a Stream-winner, one who had attained the first Magga and Fruition, and there was no need for prescribing rules relating to grave offences.
But as the years went by, the Sarhgha grew in strength. Undesirable elements not having the purest of motives but attracted only by the fame and gain of the bhikkhus began to get into the Buddha’s Order. Some twenty years after the founding of the Order, it became necessary to begin establishing rules relating to grave offences.
It was through Bhikkhu Sudinna, a native of Kalanda Village near Vesalī, who committed the offence of having sexual intercourse with his ex-wife, that the first Pārājika rule came to be promulgated. It was laid down to deter bhikkhus from indulging in sexual intercourse.
When such a grave cause had arisen for which the laying down of a prohibitory rule became necessary, the Buddha convened an assembly of the bhikkhus. It was only after questioning the bhikkhu concerned and after the undesirability of committing such an offence had been made clear that a certain rule was laid down in order to prevent future lapses of similar nature.
The Buddha also followed the precedence set by earlier Buddhas. Using his supernormal powers, he reflected on what rules the earlier.
Buddhas would lay down under certain given conditions. Then he adopted similar regulations to meet the situation that had arisen in his time.
Source: Guide to Tipitaka by Sayagyi U Ko Lay