By Grant McCool

NEW YORK (Reuters) - A former Goldman Sachs Group Inc <GS.N> programer, sentenced to eight years in prison for stealing part of the bank's high-frequency trading code, should never have been charged, his lawyer argued on Tuesday in a bid to have him released while he appeals.

Sergey Aleynikov, 41, arrested by the FBI in July 2009 and convicted by a jury in December 2010 of trade secrets theft under the Economic Espionage Act and transporting stolen property across state lines, began his sentence on March 18.

In oral arguments before the U.S. Court of Appeals for the 2nd Circuit in New York, a prosecutor, Joseph Facciponti, said a trial judge's rulings showed previous motions by Aleynikov to dismiss the charges were meritless "and not even close calls."

The government also argues that Aleynikov, a U.S. citizen who was born in Russia, is a risk of flight and should not be released pending the appeal.

The three-judge panel reserved ruling on the bail application of Aleynikov, whose case increased attention on speed-trading platforms that financial firms spend hundreds of millions of dollars to develop.

His lawyer, Kevin Marino, told the panel that the economic espionage statute specifically covered "goods, wares and merchandise" and that "every circuit has held that intellectual property such as computer source code is not goods, wares or merchandise."

Aleynikov was accused and convicted of copying and removing trading code from Goldman, Wall Street's most influential bank, in 2009 before taking a new job at Teza Technologies LLC, a high-frequency trading startup firm in Chicago. Teza and its employees were not accused of any wrongdoing.

High-frequency, computer-driven trading has become an important and competitive business. The software codes that trade shares in milliseconds are closely guarded secrets.

Aleynikov, who is a father of three and onetime collegiate-level competitive ballroom dancer, was convicted at a two-week long trial in Manhattan federal court before U.S. District Judge Denise Cote. She also imposed the sentence.

The cases are USA v Aleynikov, U.S. Court of Appeals for the 2nd Circuit in New York, No. 11-744 and No. 11-1126.

(Reporting by Grant McCool; Editing by Phil Berlowitz)