Question: As far as I understand it, an illegal contract is void, and the Polish Supreme Court has assessed that EU contract violates the Polish Constitution.

Why is Poland still considered an EU member state?

Answer: 
Opinions [vary a bit](https://politics.stackexchange.com/questions/69329/how-does-the-polish-courts-rejection-of-eu-law-supremacy-differ-from-germanys) on interpreting the Polish court decision.

According to a more strict reading of the Polish court's [announcement](https://trybunal.gov.pl/en/hearings/judgments/art/11662-ocena-zgodnosci-z-konstytucja-rp-wybranych-przepisow-traktatu-o-unii-europejskiej), they haven't declared any parts of the treaties illegal *per se*. They've only declared some CJEU decisions illegal in Poland. Under the treaties, Poland signed up to the acquis, but those decisions were taken after Poland became a member, so they don't fall under the acquis... and arguably the decisions [were a little bit innovative](https://verfassungsblog.de/commission-v-poland-a-stepping-stone-towards-a-strong-union-of-values/) in their interpretation of treaty provisions. (Although the Polish court rejected wholesale the CJEU interpretation of Article 19(1)--it's at most [two decisions](https://journals.sagepub.com/doi/full/10.1177/1023263X19892185) that are involved both taken after 2018.)

Several EU countries (including Germany in *Weiss/PSPP* and Denmark in [*Ajos*](https://verfassungsblog.de/legal-disintegration-the-ruling-of-the-danish-supreme-court-in-ajos/)) reject unbridled supremacy of EU law, to various extent[s]. If you read through the much more numerous articles that have been written about PSPP, you can find
extremely conciliatory ones that speak of judicial dialogue, but [others](https://verfassungsblog.de/germanys-failing-court/) that conclude that the principles put down on paper by the German court "directly contradict the very idea of the European Union". And
a third [kind](https://www.mpifg.de/pu/mpifg_dp/2021/dp21-1.pdf) that applauds PSPP for stemming the never-ending bias that CJEU [supposedly] has towards granting EU institutions more powers.
This is a large question but part of the answer is that not only is EU Law in conflict with the Polish Constitution but the two systems of law disagree as to which system of law has priority.

According to EU Law, EU law is supreme and the courts of Poland are duty bound to disregard the Constitution of Poland where it conflicts with EU law. So on this basis the EU Treaties (what you call the EU contract) is not illegal and Poland is still a member state.

According to the Polish constitution as interpreted by the Polish courts, parts of the EU treaties are contrary to the Polish constitution and therefore the courts of Poland are duty bound to disregard the EU treaties insofar as they conflict with the Polish constitution. As I understand it the Polish courts have not declared the EU treaties completely illegal - just certain parts of them. On this basis Poland is still a member of the EU but just not bound by some of its rules.