The closest town if you can not sleep in San Juan de Villapañada is Grado, specifically about 4 km away of it. Here you can find for example the Auto Bar Restaurant, with simple accommodation at a very affordable price, ideal for any type of pilgrim that takes a few kilometers, where they serve in their restaurant area a menu without luxuries.
There is also the option of staying at Pensión Narcea to sleep in the surroundings of San Juan de Villapañada. It is a good place to spend any night without any kind of luxury. If your goal is to rest quietly or visit the town and its surroundings this is a good option.
For those who are looking for a more pilgrim atmosphere, there is the Grado Pilgrim Hostel, it is very correct and the owners are really kind with all the guests. A very good option for those who are doing the Camino de Santiago.