I'm going to speculate based on available evidence.
Data's quarters have several unique features not seen in other crew quarters. Please point out any mistakes I have made, as this is mostly from memory.
- He lacks a visible bathroom. Most officer quarters appear to have a separate bathroom, but I don't think we ever see his.
- His bedroom appears to be smaller than other officers. Compared to Riker (who outranks him) or Troi (who he outranks). Data's bedroom appears to be little larger than a closet the few times we see it (E.G. w/ Tasha Yar).
- He has an integrated desk/work station. This station appears to be unique. It is very similar to the engineering stations or other computer terminals seen in the ship. The times we see other officers working from their quarters (Picard, Riker) it's usually with PADD's or small desktop units, and the desk is a simple piece of furniture. We do later see similar integrated workstations aboard Voyager, specifically in Chakotay's Office.
- His quarters are the only living area we see on Deck 2. The only other locations we see on deck 2 are Sickbay, and it's attached medical lab.
My theory is that Data took over a space that was not originally intended to be living quarters, but possibly a working office for the 1st Officer. We never hear it described as such explicitly, but it would make sense to have a dedicated office space for the 1st officer. Especially if we use the Intrepid class as an example of a similar era of ship design. The Galaxy class is designed for far longer cruises than the intrepid, and is far larger, so if Voyager includes dedicated spaces for Chakotay's Office, it stands to reason that the Enterprise had a similar location, even if it wasn't used as such.
Any such space would naturally be near the bridge. The captain has their ready room, and the 1st Officer would have their office nearby, or just below. It would also make sense for the office to be a bit larger than a ready room, as a 1st Officer like Riker is responsible for duty rosters and department reports, which would involve meeting with more people than Picard's ready room might be expected to host. Routine matters like this also wouldn't require the use of the main observation room on the Bridge, which is mostly reserved for ranking or bridge officers.
From what we see of Riker however, it is unlikely that he would use such a formal office. He has a much more collaborative/genial relationship with his subordinates, preferring to meet them in his quarters, ten forward, or at their assigned station. A sterile/official office wouldn't mesh with his management/command style.
So, my theory is that Data took over the 1st Officers Office, and used it as his personal quarters. Having a dedicated computer terminal/work station would suit his needs, and as the second officer his night-shift duties would match well with it's location. This would also open up another large set of living quarters which could go towards one of the families on board.