This question is impossible to answer honestly. Overwatch is a game where every situation is nuanced. What you should be doing at any given time depends on what's happening all around you.
The most basic answer I can provide is that you should never be relied on to heal a tank in the first place. Lucio heals 16 health a second. If you burn amp to heal more, you're only healing 140 HP and putting speed boost on cooldown.
In most situations you should be watching your teammates movement and positioning yourself near whoever needs extra movement speed, whether to retreat or attack. That is Lucio's primary function. Slower teammates with strong close range attacks take priority (Reinhardt, Zarya, Reaper, Mei, Symmetra), since you are mitigating their major weakness (slow speed and short range) with your ability to make them move faster.