What is the origin of the word "shul", meaning "synagogue"? It seems derived from the German "Schule", meaning "school". Moreover, Italian Jews call synagogues "scuola", which also means "school" (here's an example). So why is this?
This is just a guess, but in Hebrew a 'shul' is called a 'Beit Keneset' (a house of gathering). My guess is that in the old times, the place of gathering is where Jews would pray and teach. Even today, many shuls double as a beit midrash. (house of teaching)
Secondly, the word school itself, didn't always mean a place of learning. It also meant a place of gathering, or of doing leisure activity.