I know that Voldemort wanted to kill Harry because of Trelawney's prophecy, but why did he kill James Potter when it was Lily Potter that was protecting Harry?
James was quite literally between Voldemort and his intended victim
It might seem like stating the obvious, but James was physically blocking Voldemort's path. By killing him, he got him out of the way.
James is an important rebellion figure
It's important to remember that James isn't just the father of Voldemort's prophesied enemy, he's also an important anti-Voldemort figure in his own right, colluding with the others of his circle of friends to create the Order of the Phoenix. Even if Harry hadn't been there for some reason, it's likely that Voldemort would have still chosen to attack James.
The Killing Curse is his signature move
Voldemort often kills when he could potentially stun his opponents. He seems very comfortable with the Avada Kedavra curse and it's essentially his signature spell. Ultimately this is his downfall because rather than simply attacking baby Harry physically, he chooses to use his favourite spell (which then backfires hilariously).
He was irked by James' audacity
Lily, take Harry and go! It’s him! Go! Run! I’ll hold him off –’
Hold him off, without a wand in his hand! … He laughed before casting the curse …
You don't leave an enemy behind you
As @ChrisHayes pointed out in his comment, most spells seem to be reversible. Since Voldemort is intent on killing his son, it makes no sense to leave James Potter behind him
This goes double for leaving him alive in general. It's very likely that James would come back to seek personal revenge on Voldemort, even at the cost of his own life.
As a favour to Snape.
Snape, presumably has told Voldemort of his dislike of James Potter. It's certainly possible that Voldemort would have killed James as a perceived favour to Snape.