i'm not going to get into whether the gospels were written by who they actually say they're written by, or whoever wrote them knew very well what they were doing, but the way john and matthew write about judas compared to luke and mark is just so...,..,., brb screaming and crying
in luke and mark, who weren't there with the twelve, judas is portrayed as a one dimensional villain, pretty much just there to do the dirty work and then die. with the exception of mark 14:21 (it would have been better for that man if he had not been born) and luke 22:48 ("you betray the son of man with a kiss (because of love)" line), which are both just direct quotes said by jesus, judas doesn't seem to have any emotional significance whatsoever.
but matthew and john were there. matthew and john knew judas, they'd known him for three years at least by that point, he had followed jesus with the rest of them, he was one of them. in john and matthew's writing there is grief, there's something personal in their gospels that makes judas' portrayal biased not because of lack of further knowledge, but because of the way judas' bertrayal affected them.
matthew calls him the betrayer, he keeps reminding us of it, he says judas had been looking for an opportunity to do this. but matthew also writes of his remorse. writing a literal holy text, whether he knew what he was writing at the moment or not, he finds it necessary that people know what happened to judas, that he regretted the betrayal, that he tried to return the money.
and john, we see john try to find an explanation and swing back and forth between saying "oh, yeah, we knew from the start, when judas suggested we sell mary's ointments he didn't care for the poor, he wanted that money for himself" (even though when jesus said that someone will betray him everyone wondered if it would be them, nobody said "well it's clearly that judas guy, he's weird") and "he must've been possesed by the devil he would never do that it was satan".
matthew and john are writing all of that while trying to process the loss of someone that used to be their friend without ever getting any closure. the disciples had all followed jesus together, they'd found something in him but also something in each other. jesus knew everything, he knew judas was going to betray him, he knew his reasoning for it, he understood, he loved him regardless, but for the rest of them it was one second they were all eating together, and the next that he turned on them, and before they could get any explanation for it he was dead.