Ants are not only attracted to food but ants are also attracted to moisture and water.
Ants will be attracted to any water that's readily available to them. And bathrooms have water in them especially in the toilet so the ants will be attracted to the toilet water.