Im making a animation and i woud like to paste the rotation of a bone from one keyframe to another. But the problem is that i also paste the location of it. I tried locking the transform but it still didnt work.
Select only the keyframes you want to copy with B in the Dope Sheet and copy/paste them between frames:
If we assume you are not using automatic keyframe insertion, you can copy keyframe and paste as stated in your question.
Next only insert keyframe rotation. The menu i show choices for selective keyframe insertion. You can move the frame cursor back and forth to confirm you have only set a keyframe for rotation, not location.