I want him to learn Confuse Ray but he learns it through egg moves, how can I make it learn it instead of another egg move?
You must get it via Egg Move. There is no other way.
your current gallade can never learn that move. Only way to get it is to breed a new ralts: Male Pokemon with confuse ray, FEMALE from the ralts family (so gallade can't be used this way, but if you have a ditto you can breed a female). Resulting ralts will be born with confuse ray and growl. Comment if you need more info