The validity of the prayer is conditioned with the taharah of the body and the clothes of the praying person and the place of resting the forehead during prostration. The rest of the place where the person is praying does not have to be tahir but you should make sure your body or clothes do not come in contact with dampness with the rest of the place of prayer if it was najis. It is also prohibited to consume najis foods or drinks or what comes in contact with najis things with dampness. You are not required to check for the state of najasah in things, but you can consider things to be tahir if you do not know that they came in contact with najasah. It is not a condition or a prohibition to avoid contacting najasah or najis things in other than the mentioned cases.
We do not know the reason behind such a law since the prayer is a practice of pure worship, that consists of acts set by the Divine Legislator who likes to be worshiped in such a manner. He is the only One who knows the reason behind His desire to be worshipped in this way. The verses and the narrations did not explain such a law and we remain obedient to His orders.