you might think that the reason is that sky is not overhead during the night so it appears dark but the only reason the sky looks blue during the day is that the sun rays that falls on our earth’s atmosphere gets scattered. if you were standing on the moon which doesn’t have an atmosphere the sky always appears to be dark even if the sun was shining overhead.
then the question arises that why is space dark?
space is full of stars which are as bright even brighter than our sun. if we would look to any distant point in the sky we would be seeing many stars and galaxies that would be emitting million times more light than our sun. but still universe is dark. this is because our universe had a beginning 13.7billion years ago. due to this all the stars and galaxies are moving away from each other and our whole universe is expanding. this causes the wavelength of the emitted light to expand and shifts in the infrared part of the light. this phenomena is called the doppler effect. light waves also stretches with the expanding distance between two bodies and falls in the infrared part of light.

as our eyes cannot detect infrared part of light we are not able to see light emitted by celestial bodies in the cosmic background. thus the night sky appears dark during night.
but deep field telescopes can detect the light emitted by stars as they had infrared cameras fitted in them to detect the slightest change in the light source.