Can he really flag her and prevent her from re-entering when she has done nothing wrong and is still following Canadian Tourist visitor laws?
With precious few exceptions, none of which are pertinent to your girlfriend's case, staying in any foreign country is a privilege, not a right, and the host country can withhold or cancel that privilege at any time at its discretion. This is true of Canada, the US and Poland, and every other country in the world.
The fact that she would have to get a residence permit in the future does not seem unfair. After all, she can return without any problems if she gets the residence permit.
my poor girlfriend is treated like a Criminal
Hardly. I'm American and have been treated harshly for no apparent reason by American border guards when returning from Mexico, and that was in the 1980's long before the war on terrorism was ever even thought of. It's the price we have to pay for national security.