No it's not bad to wash your hair at night.
You can wash your hair anytime you want to wash it whether in the morning, evening, night etc.
If you do wash your hair at night just be sure to dry the hair fully with a hair dryer before going to bed.
Wet hair as the tendency to become knotted or tangled during the night as you move around in the bed.
But as long as you dry the hair before bed then it will not be a problem.
I've washed my hair at night when I take a shower and as long as I've dried my hair after washing the hair it has been fine.
It doesn't matter when you wash your hair.
Washing your hair once per week or twice per week is usually enough and if you wash the hair everyday or every night then your hair can dry out so only wash your hair once or twice per week or as needed.