The country's top court said it was upholding the ruling of a lower court. The Regional Court in Lodz had argued the principle of equality before the law meant the printer did not have the right to withhold services from the LGBT Business Forum.
The case was brought to the Supreme Court by Zbigniew Ziobro, the justice minister and attorney general, who slammed Thursday's ruling as "against freedom."
"The Supreme Court has stood on the side of state violence in the service of the ideology of homosexual activists," Ziobro said.
The Campaign Against Homophobia, which gave legal support to the LGBT Business Forum, welcomed the ruling.
The decision comes as the European Union has been warning that Poland's judicial independence is under threat due to new laws that give the conservative ruling party, Law and Justice, greater power over court appointments.
A new law regulating the Supreme Court will take effect July 3 and it's not clear if the court will be as free in the future to make rulings against positions supported by the government.
The Polish case comes as similar cases have been brought in U.S. courts. In the most high-profile case, the U.S. Supreme Court sided with a Colorado baker who refused to make a wedding cake for a same-sex couple.
Jaroslaw Jagura, a lawyer with the Helsinki Foundation for Human Rights, said there were parallels to the U.S. case.
He said the Polish Supreme Court ruled that sexual orientation, race or other features of a person cannot be the basis for refusal to offer a service, but that if the nature of the service violates the entrepreneur's freedom of conscience, it could be.
"Therefore, any such refusal should be considered individually. As a result, sometimes freedom of conscience and religion will be a legitimate reason for the refusal to perform the service, and at other times may constitute a manifestation of unauthorized discrimination," Jagura said.
This story corrects the last name of lawyer from the Helsinki foundation to Jagura.
Copyright 2018 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.