Why is it that a person who is seeking so hard to please God can be rejected, while a person who has not sought God at all can come into a righteous relationship with Him? The answer is faith and its object.
The Jews were zealous for the things of God, but their faith was in themselves. They were trusting that they could earn God's favor by their acts of righteousness. On the other hand, the Gentiles had no holiness to trust in. So, when they heard the Gospel message that Jesus paid our debt for us, they accepted His "gift" of salvation, while the religious Jews could not abandon their trust in themselves for salvation.
The same problem exists today. Millions of church people are trying to live holy lives, but they do not have a true faith in Jesus as their Savior. If they were to stand before God and He was to ask them what they had done to deserve salvation, they would immediately start recounting all their acts of holiness such as church attendance, giving, etc. Regardless of how good our actions are compared to others, they always come short of the perfect standard of God. The only response to this kind of question that would grant us entrance to heaven is to say, "my only claim to salvation is faith in Jesus as my Savior." He is all we need.