I didn't think it was unnecessary. It showed how stuck in the middle in the current situation he was in and how he loathed Ned for getting the gal he wanted the most. But he did respect Ned out of his love Ned's wife. The only reason he betrayed him was because Ned didn't play the game right. Ned approached things differently than the way Littlefinger and Varys (funny how people keep forgetting he also betrayed Ned too) played the game. If he had gotten his way then the Kingdoms would be more fucked in the ass.
However both couldn't anticipate Joffery being a major fuck-up of a king.
No, Littlefinger had planned to screw Ned over from the start. He resents him for marrying Catelyn. Even without spoiling future revelations from the book it should be clear to you that Littlefinger had been planning this for a long time. Note Tyrion's comments in the scene where he enters the council for the first time:
"It's been a remarkable journey. I pissed off the edge of the wall, I slept in a sky cell, I fought with the hill tribes...so many adventures! So much to be thankful for."
Followed by a significant look in Petyr's direction. In other words, 'I know you told Catelyn that it was my knife that was used to try and kill Bran.'
Plus, in later books it's made clear that he's been planning this for some time. It was Petyr who convinced Lysa to send her letter to Catelyn accusing the Lannisters of murdering Jon Arryn. It was also Petyr who was ultimately responsible for Jon Arryn's murder.
Littlefinger has been plotting these events since before the start of the show.
As for Varys, he is a Targaryen supporter, remember. I think he warmed to Ned when Ned refused to go along with assassinating Daenerys but, ultimately, his goal is to put the Targaryens back in power. So, I think that Starks, Lannisters, Baratheons and anyone else who get in the way of that can ultimately consider him to be an enemy.
Still, I think he was sincerely helping Ned up to a point. He's not going to risk his own life for him but Ned might have lasted a bit longer if he'd put more trust in Varys than Littlefinger.
Joffrey being...himself is in the interests of both Littlefinger and
Varys, since neither want the Lannisters to remain in power indefinitely.
EDIT: I've blacked out the Varys text because, even though you technically have the information to work that out already, it wasn't always obvious to me until later chapters and I spent a long time trying to figure out what he was up to, so maybe it can be considered a spoiler. So click at your own discretion as it contains details about Varys' motives that you might not have realised yet.