First, the phrase "right by you" is a set phrase that you can't change. It means "I want to be fair to you."
You would need more to say "for you." For example, "I want to do the right thing for you." You could say, "I want to do the right thing for you," but it changes the meaning. Now, the meaning is "I want to do something correct because of you" or "I want to the something correct to help you."
If you said, "I want to do the right thing to you," it would mean "I want to physically touch you or change you." This could sound medical or sexual, depending on the situation.
I hope that helps!