Winston writes in his diary because it's the only form of self-expression available to him. In this totalitarian society, where people aren't allowed to have opinions of their own, this is a vital outlet for those like Winston who still value the freedom to think for themselves.
Winston knows that he's taking enormous risks; just possessing a diary in Oceania is punishable by twenty-five years in a forced labor camp, or even death. But his need to express himself is greater than his fear of what the regime might do to him if they catch him.
The pages of Winston's diary are the only place where he can express his innermost thoughts. More than that, they are a site of rebellion. Here, among the diary's pages, Winston can write seditious anti-government slogans such as "Down with Big Brother." He could easily just keep such thoughts to himself, but writing them down makes them so much more subversive and gives Winston a sense that he's actively opposing the government instead of just thinking about it all the time.
Winston's seditious diary entries may not be about to bring the government crashing down, but they do at least display remarkable bravery on his part—bravery that is notable by its absence among the general population of Oceania.