They also hoped that the membership in the EU would help the economy of those new countries, thereby adding legitimacy
They hoped to exploit new defenseless markets close to them geographically. Yes, they granted legitimacy to post-commie oligarchy in exchange for a free pass to foreign capital and firm to exploit those countries as their new semi-colonies.
You remember who pushed for the accession
Dude, you talk as if that accession has happed with a snap of the fingers. Those countries had to follow all kind of pre-accession era, adopting tailor made for them by the EU new laws and what more important they agreed to open their markets and economies to strong world players from the west. It wasn't much of the competition, let me tell you.
So, people started to see it for what is was. If they wouldn't accept Poland then and there, it wouldn't happened at all, because the tide would have changed.
Poland profited a lot from this move. Now the Brits have changed their mind and proclaim that - amongst other things -
1.I fail to see how Poland profited?
2. Well, you exaggerate(by the way it was a first 'difficult' English word I have learned and still remember it sounded really exotic and mysterious to me lol)!
I would say that an immigration issue swayed/carried the vote for Brexitees but it wasn't at all the only reason as you made it to be.