Here's what your dealing with!
Water has been allowed to wick into the substrate behind the tiles (if those are tiles) and is now saturating the substrate. Until all of that is dried you will never get any new caulk to stay in place.
Remove the caulk, put a heater or a fan in there for a few days, that's correct: "Days", in an attempt to dry the walls behind the tiles. Just because everything on the surface appears to be dry doesn't mean it is dry. Allow the device to run 24 hours a day.
THEN, use any tub and tile caulk to again seal the joints. The caulk will stay when it is finally given a fair chance to work like it should.
It also looks like there are other trouble-spots behind those walls. Maybe a complete rehab is in order.