There is a certain sense of justice in this event. Remember that it is the sword of Laertes that carries the venom with which Laertes hopes to gain his revenge. Hamlet's sword does not carry any poison, so by engineering the exchange of weapons during the duel, Shakespeare allows Laertes to be hoist by his own petard, or killed by his own treachery. Hamlet unknowingly kills Laertes just as he is unknowingly killed when Laertes draws blood on him. Laertes recognises the justice of what happens:
Why as a woodcock to mine own spring, Osric,
I am justly kill'd with mine own treachery.
He later on describes the plot to Hamlet and how "the foul practice / Hath turn'd itself on me." Note how this prompts serious self-reflection on the part of Laertes and the awareness that both he and Hamlet have been tricked by the King, Claudius. Thus Hamlet delivers justice in the form of killing Claudius.
The two men are fighting with foils. Hamlet doesn't kill Laertes with a poisoned dagger but with a poisoned foil. Laertes treacherously has arranged to have a foil with the protective tip removed, and he has coated the sharpened point with a deadly poison. Hamlet while off guard is stabbed with this poisoned foil and realizes that Laertes is out to kill him. Then the stage directions say that they exchange weapons. No one is sure exactly how this is supposed to be done, but it has become fairly standard practice in performing this sequence for Hamlet to knock Laertes' foil out of his hand, then step on it to prevent him from retrieving it, and offer him his own foil in its place. The duel resumes, and Hamlet jabs Laertes with the same poisoned weapon that will soon cause his own death. The dying Laertes confesses his treachery and blames the whole death plot on the King. When Hamlet realizes that he is holding a foil still coated with poison, he uses it to stab Claudius. Meanwhile, Gertrude has drunk the goblet of poisoned wine Claudius intended for Hamlet, so there are four deaths in quick succession. It has taken Hamlet the entire length of this unusually long play to kill Claudius, and, characteristically, he can only do it in the heat of strong emotions without having time to philosophize.