A federal judge has rejected a challenge to New York state’s licensing program for selling legal marijuana, a system two California applicants say unconstitutionally discriminates against out-of-state residents.

The ruling Friday by Albany Judge Anne M. Nardacci may spur New York into issuing hundreds of licenses in a state where most marijuana is sold by unlicensed businesses.

Nardacci said the public interest in letting properly licensed businesses take over the market in New York outweighed concerns raised in the lawsuit.

She said the main purpose of the dormant Commerce Clause plaintiffs argued should allow them to access New York’s market doesn’t apply to the federally illegal cannabis trade. The clause is supposed to stop states from creating protectionist measures to restrict interstate commerce in the absence of rules from Congress.