All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
The punishment in Islam is of two kinds:
A) Hudood (plural of Hadd, which is the corporal punishment determined by the Islamic Law), and
B) Ta’zeer (discretionary punishment).
So, the Hudood are crimes on which the Sharee’ah determined a punishment for its doer, like Qisaas (equitable retribution), lashing the fornicator and the one who falsely accuses a chaste man or woman of Zina (fornication or adultery) and the alcohol drinker, and cutting off the hand of a thief.
As regards Ta’zeer, which is a discretionary punishment (whose measure is not fixed by the Sharee’ah) that the Muslim ruler imposes – then this is done according to the Ijtihaad (i.e. the effort a jurist makes in order to deduce the verdict) of the Muslim ruler or judge according to what he sees suitable. These include transgressing the religious prohibitions on which there is no Hadd or expiation. This can even be in matters which are not forbidden, like disliked matters, as stated by Ibn Farhoon in “Tabsirat-ul-Hukkaam”.
However, what was done by this woman was a forbidden matter as she lied against her husband and attributed to him what he had not done, and this is a slander. It is for this reason that ‘Umar said to her: “…And then you come to inform about him something of which he is innocent.” In addition to this, she denied the good that her husband had done to her.
The story of ‘Umar which you mentioned in the question, was also reported by Ibn Hajar in his book entitled “Al-Mataalib Al-‘Aaliyah”, through the route of Abu Daawood At-Tayaalisi and he said that its chain of narrators is strong.
Allaah Knows best.