How to fix a towel bar drywall anchor getting loose?
I might suggest my, "If you don't overbuild it, it isn't worth doing," approach by: 


locating the studs and marking their centers (they should be 16" apart); 
cut out a stud-center to stud-center swath of drywall to include where your towel bar was mounted; 
replace drywall (using a "patch piece" from local HW store - usually 16"x16", so if you do a 4"x16" strip you can afford 3 do-overs); 
tape edges of your patch, prime, texture to match, prime again, and paint. If you take your time, it'll take you a full day.


There are many ways to patch a hole in drywall and screwing to the studs offers a good, standard way to do this without adding extra stuff that isn't supposed to be there and will also be strong enough to hold your towel rack. If all else fails, you might consider replacing a half-sheet of drywall to obtain a new, strong mounting base for all towel racks. The more repairs needed to a given area, the bigger your patch should be to be able to hold what you are mounting to it.

Happy drywalling!