There isn’t any daleel except what the Prophet salla Allahu alaihi wa sallam had said when he saw the mixing of men and women while entering the masjid. he said it would be better if we make this gate only for women and the people then made it only for women.
Companions were much more righteous and Allah fearing than us. That is why scholars recommended that such partition would be applied so that men wouldn’t look at women.