In Rothenburg there is a Youth Hostel and in Wertheim you can stay overnight in the sports hall for free, and in Gemünden you can sleep in the middle school free of charge, you just need to bring a sleeping bag.