I assume that the egg is used as a binding ingredient, to help the filling "set". Older recipes probably would have called for a small amount of flour or cornstarch.
This is the recipe I settled on, but I also added a bit of nutmeg, ginger, and cloves to the crumb topping.
https://12tomatoes.com/old-fashioned-shoo-fly-pie/