The Tories said Dr Lewis's views were personal and not held by the party
Labour has called for New Forest East's Conservative candidate to be sacked after he compared HIV risks for gay men to the danger front-line soldiers face.
Julian Lewis is a member of the Conservative frontbench team and opposed the reduction of the gay age of consent from 18 to 16.
The Tory defence spokesman made the remarks in a letter to a constituent.
Home Secretary Alan Johnson has called for the candidate's sacking. But Dr Lewis said his view was "balanced".
Mr Johnson said that Dr Lewis's letter showed that the Tory frontbench team included people "who are evidently against any notion of homosexual equality".
In his letter, Hampshire parliamentary candidate Dr Lewis wrote: "I was strongly against lowering the age of consent from 18 to 16.
"My reasoning was that there is a seriously increased risk of HIV infection arising from male homosexual activity.
"When it comes to legalising practices that involve serious physical risk, I believe the higher limit should apply.
"This is the reason why we no longer allow 16 and 17-year-olds into front-line situations in the armed forces, for example.
"On the other hand (though no-one seems to have noticed), I voted in favour of the civil partnerships bill.
"One of the criticisms commonly made of gay relationships is that very often they do not last.
"It therefore seems obvious to me that, when a gay couple wish to commit to each other, by forming a permanent relationship, they should be encouraged and assisted in every way.
"We are talking about adults and so my reservations about the age of consent issue do not apply."
Alan Johnson said Mr Cameron should "show some leadership"
In a letter to Conservative leader David Cameron, the home secretary said: "As a frontbench defence spokesperson for the Conservative Party, Mr Lewis is responsible for guiding your defence policy.
"That would include allowing gay people to join the military, which was a reform Labour introduced.
"Labour also introduced an equal age of consent, which Mr Lewis apparently opposes.
"You have been actively seeking the votes of gay people throughout Britain, but your frontbench team includes people who are evidently against any notion of homosexual equality.
"You need to show some leadership and sack Mr Lewis. Otherwise your claim that the Conservative Party represents change will prove to be nothing but a shallow public relations exercise."
'Out of touch'
A Conservative spokesman said: "These are Dr Lewis's long-held and personal views, they are not the view of the Conservative Party and the terms in which he expressed them is wrong."
Dr Lewis said he had twice voted in favour of the civil partnerships bill and his views were reasoned and balanced.
Lynne Featherstone, Liberal Democrat equalities spokesperson, said: "This is a shocking reminder that the Conservative Party remain completely out of touch with modern Britain.
"It seems that Cameron's claims of change have yet to reach the rest of his party."
Mr Lewis's comments came shortly after a controversy sparked by shadow home secretary Chris Grayling's suggestion in a private meeting that he personally backed the right of B&B operators to refuse to allow gay couples to stay in their establishments.
The candidates standing for New Forest East are: Conservative: Julian Lewis; Labour: Peter Sopowski; Liberal Democrat: Terry Scriven; UK Independence Party: Peter Day and Green Party: Beverley Golden.