There's no harm in wearing socks while sleeping and in fact it's actually better for your sleep and circulation to sleep while wearing socks.
For some reason I just cannot get to sleep without having socks on my feet. Having socks on my feet makes me more comfortable and helps me to fall asleep faster.
I've heard that wearing socks to sleep can contribute to sweaty and smelling feet because your feet aren't allowed to air out.
But it's mostly a myth and no harm will be done wearing socks to bed.