We really don't know why Nicodemus came at night. It could have been the only time he could get away from his work and family affairs to see the Lord on that day. I imagine Jesus was hardly ever accesible for a private conversation (except at night after He sent the crowds home), and Nicodemus himself was a ruler, a very busy man. We are not in a position to judge his motive or heart; as Jesus Himself taught us - never judge a man externally (John 7:24)
Nicodemus said "We believe" (the Pharisees corporately), "that you are a teacher sent by God for only a man sent by God can perform all these miracles." Jesus did not then expostulate Nicodemus for coming to Him secretly, but instead said, "Unless a person be born again of the Holy Spirit, that person cannot be saved." Saying this, Jesus immediately took the focus from the corporate level of the Pharisees and brought it down to the salvific level of the individual, to Nicodemus personally.
Jesus was saying, "You guys believe I am a teacher sent by God because of all the miracles and healings you've seen. But I am much more than this; I am God the Son. In order for you to see who I truly am, and to believe in Me unto salvation, you need to be born again of the Holy Spirit."
Nicodemus was floored. Again, if his alleged cowardice by coming to the Lord at night was a component in disqualifying his salvation, you have to make the case that he already believed Jesus was the Savior. But you can't make this conclusion from the text. Nicodemus was only admitting to a corporate belief in which they as Pharisees saw Jesus was a mere "teacher" sent by God, but not the promised Messiah - and certainly not the Eternal Son of God who takes away the sins of the world.
It is interesting to note in the following chapter, we see Jesus having another one-to-one private conversation with a person, this time at a well. Astonishingly, He revealed to the woman He was the Messiah! And she believed!
Nicodemus and the others regarded Jesus as a godly "teacher", and was told they (each Pharisee individually) must be born again of the Holy Spirit to enter the Kingdom of Heaven. This presupposes knowledge that Jesus Christ is Lord. The woman at the well, on the other hand, was told directly that Jesus was the Lord, believed on it, and the new birth was never preached to her. She gladly sent for all the men of the town!
The pattern is that only after genuine saving faith in Jesus Christ as Messiah and Lord is one compelled to make an external confession. The order is Spirit, then Water.