On the contrary, "forbidding men from entering" is called Danshi Kinsei (男子禁制) (e.g., praying and performing rituals in Utaki in Okinawa (Ryukyu Kingdom)).
(The Book of Rites, internal rules), was banned as one of the Discriminations ("perverse customs") that were out of the question for a modern nation trying to compete with the Western powers.
Later, in 1872, the ban on women entering and leaving the precincts of shrines and temples was lifted by the Grand Council of State Proclamation No.
98, Shrine and Buddhist Temples Closed to Women, but Open to Climbing and Pilgrimage, allowing female spectators to watch the Grand Sumo Tournament.
98 of the 5th year of Meiji (1872May 04), which proclaimed, "Shrines and Buddhist temples shall be closed to women, and pilgrimages to mountain climbing shall be permitted.
[10] Just after the end of the Pacific War, the wife of a high-ranking official of the Allied Forces that occupied Japan once visited the village of Dorogawa, which is located at the trailhead, to request the lifting of the women's ward.
As an example of religion and faith, praying and performing rituals at Utaki in Okinawa has been the exclusive business of female priests called Noro (priestess) since ancient times, and is basically forbidden to men.
This prohibition on men is said to have originated from the fact that in matrilineality societies, women presided over rituals and sometimes reigned as queens (such as Himiko, Onarigami, and the Himeiko system).