He did it for Steve, mostly
I have little doubt about that. From the moment that Brandon shows interest in Kelly in the Pilot episode, Steve gets defensive and it makes Brandon realize that Steve's still hung up on her.
He stayed away for Steve's sake, just like he was willing to stay away from Kelly in Season 4 for Dylan's sake.