Using KJV, Verse 21 in question must be viewed as being attached to the previous verse 20, both as follows.> For every one that doeth evil hateth the light, neither cometh to the light, lest his deeds should be reproved. But he that doeth truth cometh to the light, that his deeds may be made manifest, that they are wrought in God. (My emphasis)
Doing evil or doing truth is originally tied to both a single affirmative statement by Nicodemus and his simple follow up question. First, the affirmative statement in verse 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. (My emphasis).
But Jesus did not descend from heaven to merely be a teacher of mankind. Yes, Jesus taught those believing disciples in parables. However, Jesus was NOT the schoolmaster. The Law of Moses was the schoolmaster according to Gal 3:25-26:
Wherefore the law was our schoolmaster to bring us unto Christ, that we might be justified by faith. But after that faith is come, we are no longer under a schoolmaster.(My emphasis)
Rather, Jesus spoke to them in parables, even with unbelieving Judas among and alongside them, as in Mar 4:33-34:
And with many such parables spake he the word unto them, as they were able to hear it. But without a parable spake he not unto them: and when they were alone, he expounded all things to his disciples.
Those parables were not spoken as an aid to teach unbelievers, as explained in Mar 4:10-12 when Jesus was alone with believing disciples:
And when he was alone, they that were about him with the twelve asked of him the parable. And he said unto them, Unto you it is given to know the mystery of the kingdom of God: but unto them that are without, all these things are done in parables: That seeing they may see, and not perceive; and hearing they may hear, and not understand; lest at any time they should be converted, and their sins should be forgiven them.(My emphasis)
Was not this exactly what Jesus was talking to Nocodemus about back in chapter three leading up to the OP’s question when Jesus told him in John 3:13:
If I have told you earthly things, and ye believe not, how shall ye believe, if I tell you of heavenly things? (My emphasis)
All these things considered, Chapters five, six, and seven of John all show that the big problem with some of these Jews was that they would have accepted Jesus as being the “son of man,” teacher, prophet, or even king, but they would not believe Him to be the Son of the Spirit God Savior. After He had fed the multitude from only two fishes and five loaves of bread, John 6:14 shows that they would ONLY accept Him as “that prophet” who was to be their “earthly” king of kings:
Then those men, when they had seen the miracle that Jesus did, said, This is of a truth that prophet that should come into the world.
When Jesus therefore perceived that they would come and take him by force, to make him a king, he departed again into a mountain himself alone.
So that age old spurious claim that “Jesus came the first time to be the Jews king, but they refused”, is utter nonsense. He came to first die for the sin of the people to become their “Savior.” If He were to have later died for their sin after coming into His earthly kingdom, that kingdom would have abruptly ended and another man would take His place. But Jesus will become the King of kings as the “eternal resurrected son of man” to replace the “eternal resurrected son of perdition then cast into eternal fire.” These men were all wrapped up in their own works under the law, but as Luke 16:6 instructs:
The law and the prophets were until John: since that time “the kingdom of God” is preached, and every man presseth into it. (My emphasis)
But rather, in John 6:68, they still wanted Jesus to “teach” them what to “DO” to work the works of the law:
Then said they unto him, What shall we do, that we might work the works of God?
John 7:37-39 shows the answer to this OP’s question:
In the last day, that great day of the feast, Jesus stood and cried, saying, If any man thirst, let him come unto me, and drink. He that believeth on me, as the scripture hath said, out of his belly shall flow rivers of living water. (But this spake he of the Spirit, which they that believe on him should receive: for the Holy Ghost was not yet given; because that Jesus was not yet glorified.)
John 7:40-44 shows great division among the people about Jesus:
Many of the people therefore, when they heard this saying, said, Of a truth this is the Prophet. Others said, This is the Christ. But some said, Shall Christ come out of Galilee? Hath not the scripture said, That Christ cometh of the seed of David, and out of the town of Bethlehem, where David was? So there was a division among the people because of him. And some of them would have taken him; but no man laid hands on him.
Then the back and forth between the chief priests and Pharisiees, and the officers, (including Nicodemus who raised this question beginning in verse 45:
Then came the officers to the chief priests and Pharisees; and they said unto them, Why have ye not brought him?
The officers answered, Never man spake like this man.
Then answered them the Pharisees, Are ye also deceived? Have any of the rulers or of the Pharisees believed on him? But this people who knoweth not the law are cursed.
Nicodemus saith unto them, (he that came to Jesus by night, being one of them,) Doth our law judge any man, before it hear him, and know what he doeth?
They answered and said unto him, Art thou also of Galilee? Search, and look: for out of Galilee ariseth no prophet.
And every man went unto his own house.
As for Nicodemus, After Jesus was crucified, we read in John 19:38-40:
And after this Joseph of Arimathaea, being a disciple of Jesus, but secretly for fear of the Jews, besought Pilate that he might take away the body of Jesus: and Pilate gave him leave. He came therefore, and took the body of Jesus. And there came also Nicodemus, which at the first came to Jesus by night, and brought a mixture of myrrh and aloes, about an hundred pound weight. Then took they the body of Jesus, and wound it in linen clothes with the spices, as the manner of the Jews is to bury. . Now in the place where he was crucified there was a garden; and in the garden a new sepulchre, wherein was never man yet laid. There laid they Jesus therefore because of the Jews' preparation day; for the sepulchre was nigh at hand.
This brings tears to my eyes. PERHAPS, this was given to show that Nicoodemus finally believed, and through faith, understood what Jesus meant back in John 3:21.
As to Judas, John 6:64 singles out Judas as also being an unbeliever, and, even more importantly, as "that wicked" of Psalm 109 who would betray Jesus, and who would align himself with power having Satan at his right hand and another “wicked man” over him.
But there are some of you that believe not. For Jesus knew from the beginning who they were that believed not, and who should betray him
Unbelieving Judas was that prince of this world who was cast out (See John 13:27-31). Only AFTER Judas was cast out, did Jesus speak directly to them WITHOUT parables, right on through John, chapters 13, 14, 15, 16, and up through verse 24. In that conversation, Jesus would later again emphasize WHY He descended from heaven, and that He would leave the world and ascend and go to the Father in John 16:25-28:
These things have I spoken unto you in proverbs: but the time cometh, when I shall no more speak unto you in proverbs, but I shall shew you plainly of the Father. At that day ye shall ask in my name: and I say not unto you, that I will pray the Father for you: For the Father himself loveth you, because ye have loved me, and have believed that I came out from God. I came forth from the Father, and am come into the world: again, I leave the world, and go to the Father. (My emphasis)
AGAIN, for the third time, was not this exactly what Jesus was talking to Nocodemus about back in chapter three leading up to the OP’s question? So now, with Judas gone, These believing disciples knew the difference between Jesus' proverbs (parables) and His plain speech, as they said in 16:29:
His disciples said unto him, Lo, now speakest thou plainly, and speakest no proverb.