The Egyptian army was also used in construction projects. I believe the general thinking is that the state wanted to have a military force available, but didn't want it to be idle. That reasoning would predict that every standing military would see similar uses.