Pointing a laser at a law enforcement officer is a crime. But it’s not the kind of morally reprehensible crime that can get a legal immigrant deported, says a federal appeals court.

An immigration board had ordered John Coquico of Hayward deported to his native Philippines, citing his criminal record, which included a 2007 conviction for second-degree robbery for forcibly stealing a magazine and a bus pass, and a 2006 conviction for the laser incident.

Prosecutors said Coquico was in an Alameda County Superior Court building for an unspecified matter when he took out a laser he had borrowed from a friend and pointed it at a sheriff’s deputy, who immediately arrested him. Coquico pleaded no contest to a misdemeanor and spent 19 days in jail.

Under federal law, a legal immigrant can be deported if convicted of two crimes of “moral turpitude,” generally defined as depraved and vile acts.

In an opinion by one of its most conservative judges, the Ninth U.S. Circuit Court of Appeals on Wednesday overturned the immigration board’s deportation order and said laser-pointing is not a crime of moral turpitude. A laser pointer is not a “deadly weapon,” Judge Diarmuid O’Scannlain said in the 3-0 ruling. The state Legislature, he said, “has made clear that laser pointers, and the beams they project, are innocuous,” allowing their use in elementary school instruction and imposing only minor criminal penalties for their misuse.

Even the misdemeanor of deliberately pointing a laser at a law enforcement officer to cause “apprehension or fear,” to which Coquico admitted, does not require proof of actual harm and can’t be classified as an act of moral depravity, O’Scannlain said. The court ordered the immigration board to reconsider the case.

Coquico entered the United States with his mother, a legal resident, in 1997 when he was 9. He’s now 27 and still lives with her. His father is a naturalized U.S. citizen. His lawyers could not be reached for comment.

Bob Egelko is a San Francisco Chronicle staff writer. E-mail: begelko@sfchronicle.com Twitter: @egelko