Since the local church, as the body of Christ, is ultimately responsible for what it does with the Lord's Supper, for a church to allow someone that it does not know to be saved and in fellowship with God would seem to be placing that church in danger of abusing the body and blood of Christ. Hence, it is actually well within the interests of a local church to close communion in that local church to members of that particular body.
Remember, Matthew 7:1-4 applies to hypocritical judgment stemming from condemning another while being guilty of the same yourself. That verse is NOT meant to be taken out of context as a blanket condemnation of all "judgment". If it were, then why did Jesus also instruct His disciples to "judge righteous judgment"?
The judgment I was referring to is what was talked about in 1 Cor 11. There we are told to judge ourself rightly it’s not about judging others. Paul did address the church but concluded by tell all to examine themselves. He could have told the church to refuse the Lord’s Supper to those in error but he caution all to examine themselves.
Matt 7 talks about judging others and I agree with you that it should be a righteous judgment.
Suppose I walked into your congregation, How would you know to refuse me to take the Lord’s supper or not?
Not being argumentative just never heard of church denying other the Lord’s Supper