Simply put, money is not the only form of compensation.
We already have a question that covers why people might wish to join Starfleet, so I won't belabor the points of self-actualization and personal satisfaction.
That said, even in a post-scarcity economy, there is a recognizable social strata. People will have their own goals, and will have their own motivations and desires.
We know that different sizes/types of quarters exist in Starfleet - several times in Next Generation, Picard or Riker will specify the type of quarters a guest or visiting/rescued person should be assigned.
To the best of my knowledge, we only see the quarters of officers during Star Trek (excepting a few times we see 'enlisted barracks' in TOS-era movies). This leads me to believe that advances in rank do lead to advances in lifestyle, even without the concept of money.
So there is one potential reason: while your needs will be 100% met, guaranteed, there are always increased levels of comfort that can be attained.
To further that, many people seem to believe that the Holodeck is some panacea, which can cure all entertainment ills. While it probably can, Holodecks require power, programming, maintenance, and (above all) time. The Enterprise D had roughly 1,000 crew members, and 7+ holodecks. If an average holodeck session lasts 30 minutes, this means that a minimum of 336 holodeck sessions could be scheduled per day (48 30-minute sessions per holodeck, 7 holodecks, with an additional 48 sessions per holodeck it has above 7). That would mean that a crew member could expect to use it once every 3-4 days, on average. Given that holodecks seem to frequently not be in use (since we never see a time when the command crew have difficulty finding an empty one, or have to interrupt a session in-progress that doesn't involve Barclay) it seems much more likely that holodeck sessions are more commonly once per week (on average).
Therefore, I suspect that higher-ranked crew members likely have more access to the holodeck and/or more flexibility in scheduling their holodeck sessions.
So, to summarize:
- Higher rank leads to increased size, quality, and comfort of quarters.
- Higher rank likely leads to increased access to holodeck recreation.
- Higher rank possibly leads to improved self-worth (for certain personality types)
- Higher rank leads to more ability to influence the world/universe around you (similar to the above) including (but not limited to) giving orders, setting policy, and making decisions.
- Higher rank may lead to increased non-monetary compensation (leave time, replicator access)
- Higher rank leads to more and different responsibility, which can include the ability to avoid unpleasant duties.