The idea is to present yourself to Allah as pure as possible.
Also when entering the Mosque one is to enter with the right foot first, and exit with the left.
When in the Mosque men are on the main floor and the women are on the top floor looking down,that way when everyone bends down to pray the men can't lust after a woman whom may be bent in front of him praying. That is a main point way men and women are separated in the Mosque.
Praying is done many times a day, on a timely schedule.
As to why Muslims pray, it would be best not to get into a discussion as every religion has a particular set of rules or beliefs and would not be right to comment. In the Muslim religion it is necessary for a follower of the religion to pray via the method of the Namaz. It is also said that the praying method of Namaz if not followed five times a day is a very big sin. Also the Muslims are suppose to pray every Friday in the afternoon, this day is known as the "Jumma" and it is compulsory for every Muslim.
The Muslims pray because it is in their religion, it is written in the Quran that:
"The true believers are those who feel a fear in their hearts (of the consequences of violating the commands of God) when God is mentioned. And when His Revelations are recited to them, they find their faith strengthened. They do their best and then put their trust in their Lord." (8:2)"
Muslims pray 5 times a day. Before praying Muslims make themselves clean and then stand for prayer. During the prayer they recite verses from Qur'an, they bend towards Qiblah (ka'aba), they prostrate towards Qiblah. Basically Muslims are told to imagine that they are praying before Allah (God). They pray to show the gratitude and submission towards Allah.
The Position of Islamic prayer1- As-Salah is the second pillar of the five pillars of Islam.
The Prophet ﷺ, said: “Islam is built upon five pillars: Witnessing that there is no god but Allah and that Muhammad is His servant and Messenger, and establishing the prayer…” [ Agreed upon.]2- As-Salah is the best of actions.
The Prophet ﷺsaid: “The best of actions is the prayer early in its time.” [ Source: At-Tirmidhi.]3- As-Salah is the line between Islam and Kufr (disbelief).
The Prophet ﷺ said: “Indeed between a man, and shirk and Kufr, is abandoning the prayer.” [ Source: Muslim.]