The era of Rasulullah (Sallallahu Alayhi Wasallam) was a mubaarak era. It was an era where Wahi (revelation of the Quraan) was being received from Allah Ta’ala. New Shar’ee laws regarding various issues were constantly being revealed by Allah Ta’ala and there was a need for Sahaaba to learn the laws of Deen relating to salaah, fasting and other injunctions directly from Nabi (Sallallahu Alaihi Wasallam). Generally Nabi (Sallallahu Alaihi Wasallam) would educate the Sahaabah after salaah. Hence women were permitted to attend the congregational Salaah in the Musjid in order to learn the laws of Deen.
However, it should be borne in mind that the era of Rasulullah (Sallallahu Alayhi Wasallam) was the khairul quroon (the best of eras). The greatest honour of that era was