This question is based on a false/baseless story. In Bukhari, the most authenticated Hadith book in Islam, you find a different stance from Umar
حَدَّثَنَا يُوسُفُ بْنُ مُوسَى، حَدَّثَنَا أَبُو أُسَامَةَ، حَدَّثَنَا عُبَيْدُ اللَّهِ بْنُ عُمَرَ، عَنْ نَافِعٍ، عَنِ ابْنِ عُمَرَ، قَالَ: كَانَتِ امْرَأَةٌ لِعُمَرَ تَشْهَدُ صَلاَةَ الصُّبْحِ وَالعِشَاءِ فِي الجَمَاعَةِ فِي المَسْجِدِ، فَقِيلَ لَهَا: لِمَ تَخْرُجِينَ وَقَدْ تَعْلَمِينَ أَنَّ عُمَرَ يَكْرَهُ ذَلِكَ وَيَغَارُ؟ قَالَتْ: وَمَا يَمْنَعُهُ أَنْ يَنْهَانِي؟ قَالَ: يَمْنَعُهُ قَوْلُ رَسُولِ اللَّهِ صَلَّى اللهُ عَلَيْهِ وَسَلَّمَ: «لاَ تَمْنَعُوا إِمَاءَ اللَّهِ مَسَاجِدَ اللَّهِ»
Translation:
Narrated Ibn Umar:
One of the wives of Umar (bin Al-Khattab) used to offer the Fajr and the Isha prayer in congregation in the Mosque. She was asked why she had come out for the prayer as she knew that `Umar disliked it, and he has great ghaira (self-respect). She replied, "What prevents him from stopping me from this act?" The other replied, "The statement of Allah's Messenger (ﷺ) : 'Do not stop Allah's women-slaves from going to Allah's Mosques' prevents him.