Riker didn't want a command because it would mean hanging around the bridge. Look at what happened to Janeway...
That's an interesting notion, that Riker desired to remain a commander for much the same reason that Kirk wished to remain a captain. By TNG's timeframe, the first officer led the away missions while the captain stayed on the bridge. That way, Riker gets to insist that Picard stays aboard the ship for "protection", while he goes down to all the planets and has some great adventures!
Hence Picard and Riker's exchange in Nemesis
; P: "When your first officer insists that you can't go on away missions..."
R: "Ignore him! I intend to!"