Maryland's highest court today ruled against a Hagerstown tavern owner who set up a "tip jar" numbers game in his bar and argued that laws allowing such games in service and fraternal organizations in 18 Maryland counties illegally discriminated against private bar owners like himself.

In January, a Washington County Circuit Court judge had agreed with the tavern owner, Roy Miller Snyder Jr., and dismissed illegal gambling charges against him and two employes. Today's Court of Appeals decision means that the trial against the three men can continue.

Private tavern owners in Washington County have long complained that organizations such as the American Legion and Elks Club are driving them out of business by undercutting their food and drink prices with the help of gambling profits. But when Snyder, who owned the Locker Room Stag Bar, tried to fight back by putting a "tip jar" in his tavern, he and two employes were charged with illegal gambling.

"Tip jars" are the most popular form of gambling in Washington County. Packets of five numbers are sold for $1 and pulled from glass containers. Winning numbers pay up to $10 immediately or $100 after the last batch of numbers is sold.

According to testimony in Snyder's Circuit Court trial on Jan. 22, clubs in Washington County have taken in several million dollars from gambling in recent years and donated only about 5 percent to charity.

Before the trial was over, Circuit Judge John P. Corderman dismissed the case against Snyder and his two employes, Richard W. Wyand Sr. and Albert L. Bryan, agreeing with them that laws allowing some forms of gambling in fraternal, religious and charitable organizations were illegally discriminatory. Corderman, who helped sponsor the exemption for such clubs as a state senator in 1975, said in his written opinion that "the parsimony" of some of the clubs would "make Ebeneezer Scrooge look like a philanthropist in comparison."

But the Court of Appeals decided today that there was nothing to forbid the clubs from keeping their gambling profits, as long as they were not used to benefit individuals, and that the state legislature presumably felt there were justifiable reasons to exempt such organizations.

The court wrote that Snyder had raised a challenge "to the wisdom, not to the constitutionality" of the law in question.

Snyder, who has since sold his Locker Room Stag Bar, could not be reached for comment. His attorney, Kenneth Mackley, said the ruling means private tavern owners will continue to face unfair competition.

"These guys can't survive," Mackley said. "Unless you have girls with wet T-shirts and that sort of thing, they don't have a snowball's chance."