The actual purpose of creation of man is to worship God
وَمَا خَلَقْتُ الْجِنَّ وَالْإِنسَ إِلَّا لِيَعْبُدُونِ
It is to make a man remember God all day, in different parts of the day, by breaking his routine to spare time to remember his Creator. The importance of this was illustrated in the dream of the prophet where he was given 50 prayers by God for his people and then the prophet requested to make them less and then 5 prayers were approved. The lesson was the actual importance of prayer, that is, remembrance of God which should be the sole job humans should do the whole time. However, since the scheme for humans is different, they have to accomplish their job of remembering God along with their mundane works, therefore only 5 times in different parts of the day are appointed.