To be born of the Holy Spirit we must be immersed in the Holy Spirit (John 3:6), which only comes from service of God and his children, which is what Matthew 25 is talking about, so that we can receive the Holy Spirit, get to know the fruits (Galatians 5:22-25) and be new men in Christ. But this is only thru baptism and confirmation of the Holy Spirit.:
John 3:1-6
King James Version
3 There was a man of the Pharisees, named Nicodemus, a ruler of the Jews:
2 The same came to Jesus by night, and said unto him, Rabbi, we know that thou art a teacher come from God: for no man can do these miracles that thou doest, except God be with him.
3 Jesus answered and said unto him, Verily, verily, I say unto thee, Except a man be born again, he cannot see the kingdom of God.
4 Nicodemus saith unto him, How can a man be born when he is old? can he enter the second time into his mother's womb, and be born?
5 Jesus answered, Verily, verily, I say unto thee, Except a man be born of water and of the Spirit, he cannot enter into the kingdom of God.
6 That which is born of the flesh is flesh; and that which is born of the Spirit is spirit.