Chuck Hagel, a candidate for secretary of defense whose record on gay-rights issues has come under fire in recent days, apologized on Friday for remarks he made as a senator that an openly gay man nominated for a diplomatic post should not represent the United States. “My remarks 14 years ago in 1998 were insensitive,” Mr. Hagel said in a statement, referring to a newspaper interview he gave about James C. Hormel, a San Francisco philanthropist nominated by President Bill Clinton as ambassador to Luxembourg. “They do not reflect my views or the totality of my public record, and I apologize to Ambassador Hormel and any L.G.B.T. Americans who may question my commitment to their civil rights,” Mr. Hagel said. “I am fully supportive of ‘open service’ and committed to L.G.B.T. military families.” Since Mr. Hagel’s name emerged as a candidate for the Pentagon last week, he has been sharply criticized for his record on Iran, Israel and militant groups like Hamas and Hezbollah, as well as comments he made about pro-Israel lobbying groups in Washington.