What are the (evolutionary) advantages of secondary transport?
I think an easy analogy for why this approach evolves is to think of how humans use electricity (or energy more broadly).

Although it is feasible to have localized electricity generators (for example, a solar panel on a simple calculator), it's typically more efficient to have centralized electricity production. With that organization, changes to the electricity generating machinery can proceed without any changes needed at the end user. If the power plant improves efficiency by 10%, that improves the efficiency of the entire system without a change needed in every lightbulb, refrigerator, and phone charger.

Once an ion gradient is established, different independent systems can use it to perform otherwise energetically unfavorable tasks. Of course this is not the only way evolution could proceed: as linked in a comment there are several general explanations for why evolution doesn't produce every possible combination. There are in fact a lot of proteins that use ATP directly.

The sodium-potassium ATPase that powers one of the major secondary transport systems is particularly interesting because it moves 5 ions at a time, making it very efficient. It would waste ATP if it only exchanged 2 ions at a time. By producing that gradient, other proteins can then evolve to use this gradient at an appropriate energy level rather than needing to work on a "1 ATP = 1 cycle" basis.