Happened to me too, so many times. The only way I could avoid this glitch was by assigning them other tasks like demolish, fishing, cutting and etc. However, right after that, they would go back to carrying water back and forth without doing much work. They wouldn't build or repair structures.