And by worst role, I don't mean weakest, I mean most detrimental to the quality of the game.
While the title might be hyperbolic (there are at least four roles in the game that are worse for the game than the spy), I do believe that the mere existence of the spy is detrimental to the quality of the game itself.
The spy is able to see who the mafia kills and who they target, these abilities on their own are decent enough, if not a bit underwhelming at times. But combined with the fact that the spy is exclusively a town power role (therefore making role counting much easier when there's a confirmed spy in the game/graveyard), the spy would be perfectly fine, if not a bit underwhelming for a power role.
But of course the spy has one more notable ability: the ability to read mafia chat at night. On the surface this seems like a neat ability - after all every now and then it's a lot of fun to catch a mafia based off of their typing patterns in day chat vs night chat as spy; or to trick a spy by emulating a townie's typing pattern during the mafia night chat. But in practice this occurs very infrequently and almost exclusively among new players. After all, it takes a player getting caught by spy due to their typing only once, or for a spy to be tricked by mafia only once for them to wise up and not make that mistake again.
So in practice the spy's ability to read night chat really only has one effect: it stops the mafia from attempting to coordinate or implement any advanced strategies.
Because the spy can read night chat the mafia never tries to coordinate their role claims with each other, they're reluctant to share the information they've found via the agent, they're reluctant to discuss who they should roleblock or blackmail due to risking creating confirmed townies in the spy's last will, they're even reluctant to acknowledge each other's roles so that the spy doesn't reveal that the investigator in the game is actually a consigliere turned godfather after the godfather died!
Even when a spy isn't guaranteed, even when it's only a 20% chance, mafia will still refrain from attempting more advanced strategies due to how potentially incriminating and game losing a spy listening in could be.
This suppression of strategic choices the mafia has at their disposal is arguably the strongest part of the spy. It's so strong that it has shaped the meta of the game to the point where the spy doesn't even have to be in the game to have this effect. There could be a 0% chance for a spy and the mafia will likely not even attempt more advanced strategies due to how off-meta this kind of mafia strategizing has become due to the risk of the spy. (Ironically this also makes the spy the strongest when it's not in the game. The spy's strongest ability is the suppression of mafia strategy, but since it doesn't have to be in the game to have this effect, that means when it is in the game, all you're left with is an underwhelming power role)
Depriving the mafia the ability to coordinate, develop, and implement more advanced strategies has several knock-on effects as well. Primarily it weakens the strength of the mafia, hosts counterbalance this weakening in a number of ways, but almost all of these measures end up shifting the balance in mafia's favor by increasing the randomness in the game at the expense of strategy and deception.
TL;DR The spy's ability to read night chat prevents mafia from coordinating and strategizing. This effect has permeated the meta leading to far less strategic and coordinated play from the mafia, requiring them to be buffed in other ways, all in all degrading the quality of the game.