Claudius halts The Mousetrap because its plot—a king murdered by his brother pouring poison in his ear—mirrors his own murder of King Hamlet.
He fears the play is a public accusation that could turn the Danish court against him. His guilty reaction ("Give me some light. Away!") confirms the Ghost's story to Hamlet.
The play-within-a-play succeeds as a trap: "The play's the thing / Wherein I'll catch the conscience of the king."