David Pannick QC quoted a letter from a former Lt Cdr in the Royal Navy who had described his sexuality as "no more relevant than whether I eat fish on Fridays".
Mr Pannick was arguing the case of four dismissed servicemen and women who are fighting to overturn the policy which leaves Britain virtually isolated in the Western world. They say the policy also breaches the European Convention on Human Rights and European Union equal opportunities legislation.
In June, two High Court judges ruled against the four, but Lord Justice Simon Brown, said the tide of history was against the ban and Mr Justice Curtis said it was not based on evidence. Since then the Government has announced a review to report by January, but defence chiefs have made it clear they support the ban.
This week's appeal hearing has been found a date with unusual speed after the Ministry of Defence had blocked an application to allow the case to go directly to the Lords. It is being heard before the top civil court judge, the Master of the Rolls, Sir Thomas Bingham, and two other appeal court judges.
Mr Pannick said that the ban on gays was irrational in terms of law. He said there was no discretion to overlook homosexuality. Gays were forced to leave even if they were not indulging in sexual activity. They were forced out even if they kept their sexual behaviour completely off the military base. They had to leave, however distinguished their military record.
"British forces personnel serve alongside gays from other counties without, on the evidence, any problems," he said.
"If a man has a stable relationship with a civilian and lives away from the military base, he will be discharged. Yet he can have an affair with a fellow serviceman's wife and not be discharged."
The four appealing are former Lt Cdr Duncan Lustig-Prean, 36; Graeme Grady, 32, a former RAF sergeant; John Beckett, 25, a former navy weapons engineer and Jeannette Smith, 29, a former RAF nurse. The case continues today.Reuse content