I see it like this: This parable parallels John 3:16.
Everyone, bad or good, is invited, and everyone who sincerely comes to the wedding feast is accepted.
We are told in Rev. 19:8 that our garments in heaven will be fine linen which consists of our righteous acts: “And to her it was granted to be arrayed in fine linen, clean and bright, for the fine linen is the righteous acts of the saints.”
So back to our parable. Apparently, everyone at the wedding feast had come to the Lord, and it was clearly evidenced by the white fine linen they were arrayed in. I can only surmise that when anyone accepts Jesus Christ as Lord and Savior, this, in God’s eyes, is one humongous righteous act! But see, there was one fellow there who was an imposter, for lack of a better word (like a Pharisee?). Yep, he was naked as a jaybird. He did not love the Lord and did not accept His gracious invitation (to be saved) in his heart. He was faking it, and he had not one single righteous act. Thus, the punishment.