Contract Marriage (Mutah)
Its difficult to assess the conditions during Prophet Mohammad saw and Hazrat Umer RA time. Perhaps, Hazrat Umer RA criminalised it due to the pertaining conditions. Similar steps were taken in Hazrat Ali RA time to criminalize alcohol by 80 lashes, as mentioned in the thread posted by Umer sb. I highly recommend to read the thread posted by Umer sb.
Please also refer to the video below from 7:36 to 11:14 https://youtu.be/3kfdJeY-9As?t=456