Ali Harbi Ali, 26, told the court he had no regrets, adding “If I thought I did anything wrong, I wouldn’t have done it”.
He denies murder and preparing acts of terrorism.
He told jurors at the Old Bailey: “He [Sir David] voted previously in Parliament, not just him… I decided if I couldn’t make hijrah, if I couldn’t help the Muslims [in Syria], I would do something here.”
Asked what difference killing Sir David would make, he said: “For one, he can’t vote again.
“If he had previous for doing votes like that he won’t do it in the future, and perhaps send a message to his colleagues.”
He added: “So hopefully, he won’t be able to harm Muslims in that regard.”
He said that another “big problem” for him about Sir David was his membership of the Conservative Friends of Israel Group.
Under cross-examination by Tom Little QC, Mr Ali told the court he had no regrets about killing Sir David, 69, during a constituency surgery at Belfairs Church – but denied being “utterly shameless”.
He said: “I wouldn’t use the word ‘shameless’, but I don’t have any shame.”
Mr Little said: “You don’t think you did any thing wrong?”
Mr Ali replied: “If I thought I did anything wrong, I wouldn’t have done it.”
He also retracted comments made to police saying he would not now class his actions as “terror”, saying the attack on Sir David was comparable with the actions of MPs who voted for Syrian airstrikes.
He told the court: “I don’t think I would use those words now.
“If I was to use that word on myself, I would expect the British politicians who bombed Syria to use that word on themselves.”
He also denied being a radical Muslim, insisting “I am a moderate Muslim”.
Mr Ali told the court he had expected to be shot and die “a martyr” but when he realised the two officers who entered the building were not armed he decided to drop his knife.
‘Hopefully kill Michael Gove’
The trial previously heard Mr Ali, of Kentish Town north London, had plans on his phone describing possible attacks on cabinet minister Michael Gove.
He told the jury when he came up with the plan he hoped to “attack and hopefully kill Michael Gove”.
“I believe he was someone who was a harm to Muslims.
“I thought if I couldn’t go join Islamic State, I should try and do something here to help Muslims here,” he said.
He “deeply” regretted not being able to join the terrorist group, he told the court.
Mr Ali said he wanted to travel to Syria between 2015 and 2017, but did not go as it was “difficult”.
He told defence counsel Tracy Alying QC: “As a Muslim, I was obligated to do something during that period.”
Concluding his evidence, Mr Ali said he hoped that by killing Sir David, other MPs would “cease hostilities with Muslims”.
Mr Ali also said it was very likely he had a knife in his rucksack when he was captured on CCTV outside the Houses of Parliament in the months before he killed Sir David.
The trial has restarted after a 10-day delay due to three jurors and the judge in the case testing positive for Covid-19.