A Vista judge on Friday rejected an argument that former District Attorney Paul Pfingst tried to hide evidence in a Carlsbad murder case.

“It does not appear to this court that there was misconduct by Mr. Pfingst in any way,” Superior Court Judge Blaine Bowman said.

Pfingst represents 40-year-old Julie Harper, who is accused of killing her husband, a Carlsbad High School math teacher.

At issue was Pfingst’s knowledge of a backpack found at the Scripps Ranch home of Harper’s father, where she was arrested on Aug. 8, 2012, the day after her husband’s body was found.

The backpack contained passports for Harper and her children, cash, and a gun — although it was not the gun used to kill Jason Harper, 39.

Deputy District Attorney Keith Watanabe argued that Pfingst should have told investigators about the bag, which police did not initially seize.

Days later, Julie Harper’s father noticed the bag. He showed it to Pfingst and a defense investigator, handed them cash from the bag for bail or legal fees, then put it in his garage attic.

The father led police to it during a second search of his home.

Pfingst said he had no plans to keep the backpack from the prosecution, and instead planned to use it to show that his client intended to take her children and leave a husband she said was abusive — not to kill him.

He said the evidence was properly handled under court rules.

Pfingst was the county’s district attorney from 1994 to 2002, when he was defeated by Bonnie Dumanis, who continues to hold the post.

Harper’s trial is set for April. She remains out of jail after posting $2 million bail.