She was conditioned by the Silence to kill the Doctor through repeated brainwashing. This lead to her attempting to kill the Doctor via poisoned lipstick. However, she didn't succeed, as she came to like the Doctor after meeting him, and so gave him all her regenerations to save his live. ("Let's Kill Hitler") The second time she tried to kill him, it was because the Silence forced her into the spacesuit which forced her to shoot the man she thought was the Doctor. She tried to stop this by discharging her gun early, but that lead to the collapse of space-time. The Doctor eventually managed to convince her to shoot the body which looked like his as it was actually the Teselecta, not the Doctor himself, who was being shot. ("The Wedding of River Song") So, long story short, she attempted to kill the Doctor because of conditioning by the Silence, but has never succeeded.