Is he brought back simply because J.J Abrams thought the franchise needed another villain apart from Kylo Ren, after the death of Snoke? Is it simply for fan service? Or is there a more meaningful, story-driven purpose to the inclusion of Palpatine in The Rise of Skywalker. The answer seems to be the latter. In an interview with Empire, director of The Rise of Skywalker, JJ Abrams, had this to say:

How exactly Abrams has written the character back into the Star Wars saga is still kept under wraps. Did Palpatine survive the fall? Did he come back from the dead? More importantly, what is his plan? I guess we’ll have to wait until December to find out. Star Wars: The Rise of Skywalker synopsis: The surviving Resistance faces the First Order once more as Rey, Finn and Poe Dameron’s journey continues. With the power and knowledge of generations behind them, the final battle commences.

Star Wars  The Rise of Skywalker   JJ Abrams Explains Why Palpatine Needed to Be included - 36