Are there any advantages when competing in a raid at a friendly gym?
After defeating the Pokemon, you get a limited number of special poke balls (Premier Balls) to try to catch it. The number of balls you get is based on several factors, including team control of the gym.
So yes, winning a raid battle at a friendly gym gives you more chances to attempt to catch the Pokemon after winning than a gym controlled by another team.
Here are two screenshots after defeating a raid boss solo on a Mystic-controlled gym. The first is by an Instinct player; the second is Mystic.