Before a village had a gurdwara it had a dharamsala: a room or a walled yard kept for travellers, for reading, and for the sangat to sit in. Guru Nanak Dev Ji's own sangats met in dharamsalas and the word is the older one.
It served as guest house, school, meeting hall and place of worship at once. A traveller could sleep in it without asking anyone.
The change from dharamsala to gurdwara, with a Guru Granth Sahib Ji installed and the building given over to that, happened at different times in different villages and largely under the Singh Sabha reform from the 1880s.
In many villages the old dharamsala building still stands beside the new gurdwara and is used for storage.
Where a village has more than one gurdwara, the reason is almost always caste. That is a plain fact about rural Punjab and it is stated on this site because leaving it out would make everything else here less true.
The dharamsala was the village's public building before the gurdwara took the name and the function: a place for travellers to sleep, for the sangat to meet, and for the village to gather.
The word is still used in the Malwa for a gurdwara and in the hills for a rest house, which is where the town of that name gets its own.
Every village had one. What it was for is now split between the gurdwara, the panchayat ghar and the marriage palace on the bypass.