At its very core, a punishment is a denial of a right, which is decidedly different from revoking a privilege. While technically in both cases it has a negative impact on the recipient, these are judged in very different ways.
There's a perceptional difference between doing something and choosing to not do something. It all depends on what the baseline is and whether your actions are willfully deviating from the baseline.
Collective punishment refers to actively doing something different from the baseline (i.e. willfully creating a negative consequence), and applying this to a large demographic based on a justification that applies only to a subset of that demographic.
The implicit baseline here is "live and let live", i.e. this wouldn't be happening except that you chose to enact this punishment, and the way you are treating this demographic is not how you treat everyone else.
In terms of entering a nation's borders, the baseline is that no one is entitled to enter (other than its own citizens). Access is only granted on a basis of active consent from that nation. Therefore, a nation not letting in a specific nationality is not deviating from the baseline. It's exactly on the baseline, with no additional privileges being granted.
Using a simple analogy, just because I give my friends a key to my house and tell them they're free to come over when they want to, does not mean that I am "punishing everyone else" by not also giving them a key to my house. That's not how this works. The baseline is that no one except me (and any other people living here) have access to the house. Extending that privilege to others does not bind me to extending it as a right to just anyone.
In order for you to claim that banning a nationality from entering another nation is collective punishment, it would require you to first argue that everyone is inherently entitled entrance to this nation (which would then be the baseline), because that would then allow you to argue that disallowing a certain demographic from entering said country would be creating a punishment that deviates from the baseline.
This is not the case, and any country that were to default to entitling every person unbridled access to their borders as the default effectively does not exert any real control over its own borders.
It's not impossible for a nation to do so, but it is decidedly unlikely that a nation would ever choose to do so because of the obvious drawbacks with no real benefits.
So, no, not being allowed in a country is not the same as being punished.