There are some abilities (such as Berserk and Competitive) that boost a Pokémon’s stats and moves when hit with various kinds of attacks. Using an attack on your ally with the intent of activating their ability at just the right time can be helpful.
Additionally, moves like Conversion and Conversion 2 can change a Pokémon’s type to resist the attacks or type of the target. If you know for sure the effect your ally would have on the move, this can be an advantage.
I’m sure there are many more, but this was all I could find for now.
Source: the database