There is an out-of-universe explanation. I can't give you links on it, but during the summer between seasons 1 and 2 of Star Trek: The Next Generation, there was a convention in Richmond, VA. Now, I'm not a big convention-goer, but I have a rule: Whenever there's a Star Trek convention in my home town, I go. (So I've been to both conventions held in Richmond!)
David Gerrold was one of the honored guests and, at the time, he had left ST:TNG to start developing his own series (which, as best I known, never hit the screen). But he had worked on ST:TNG during the development of the series and into the first season.
One question focused on Marina Sirtis' acting skills and lines, especially in Encounter at Farpoint. Gerrold's response was, essentially, that they still weren't sure what to do with her and they weren't even completely sure she was going to be in the series. He commented that he didn't blame her for any difficulties with the pilot because they didn't know what to do with the character and she didn't even know if she was going to have a job or not. She knew the character was still not a sure thing.
The character of the Ship's Counselor first showed up in the original series bible for Star Trek: Phase II (not the episodes currently in production, but the planned 2nd Trek series in the 1970s). It's clearly something Roddenberry wanted in Trek, but since such a character was a new idea, they weren't sure how such a character would be used, if they could justify her presence on the ship, and if she fit in a dramatic function.
In Encounter at Farpoint, they were still experimenting with Troi, so her being in a uniform was not something they had thought about. She was on the crew, so she wore a uniform.
While he didn't give details about after that which would apply directly to this question, they needed to do something else with her. (Other than have her in pain whenever a new alien came around and saying, "I sense something...") And they also needed to emphasize her role as a counselor and not just an away team member. While I don't have proof for this, it seems that having her in more casual clothes (or perhaps a casual uniform, a little like fatigues or something) would de-emphasize her role as an officer and emphasize her role as a guide and counselor, including with the civilians on the ship.
As to why she later put the uniform on in Chain of Command, well the new Captain was rather a by-the-book person and insisted on it.