The philosophy of observing Hijab while saying prayers is not only to avoid being seen by strangers and that Hijab is not needed while alone or not saying prayers but Hijab while saying prayers is a slogan of personality and dignity for woman and it is symbol of chastity and modesty for women so that by which they can keep it and observe it at times while not saying prayers. As mentioned in the Holy Quran Allah Almighty is present everywhere and at any time. Moreover, Allah Almighty has ordered all Muslim to say their prayers while heading a unique place named Mecca; the reason for this command is for a great deal of benefits and philosophies lie in this order of Allah Almighty. Observing Hijab while saying prayers is also because of philosophies as standing toward Mecca while saying prayers has reasons and philosophies.
source : erfan.ir