Riker was my favorite character on TNG.
As for why he stayed on the Enterprise, I think it may have had a lot to do with it being the flagship. And I'm not saying he stayed for the prestige of being on it, but for the unique opportunities it gave him. He got to lead away missions on different worlds, be a part of high profile events that he wouldn't have on some random Federation ship. I think he loved the experiences the Enterprise gave him, and he was in no hurry to be a captain, as he was confident enough to think he would have his own command when he was ready to leave. The romantic in me makes me think part of the reason he stayed, and he may not have even been aware of it at the time, was his feelings for Troi. I think deep down he always wanted a happy ending with her.