Leonard always wears socks when he goes to bed with Penny.
This seems pretty weird to me. Is there any specific reason why he does this?
It's not explained in the show, but there are a few theories worth exploring.
Leonard has a general issue with nudity
This potentially relates to poor body image or the fact that he had a traumatic experience seeing his father and mother engaged in pre-coitus spanking at an impressionable age:
Mrs Hofstadter: When you were six years old, you walked in on me and your father naked. I was swatting his bottom with your brand new Ping Pong paddle.
Leonard: I didn’t dream that?
Leonard: No, no. We cover ourselves in body paint, and then, then we get on this big canvas and do our thing.
Penny: Whoa, that’s kind of a big step for a guy who only recently agreed to take his socks off. ... let’s you, me, and your very, very pale feet make some art. Hey, when you got back to this store, I want to go with you.
The floor is cold
We know from 'The Barbarian Sublimation' that the floor outside the apartments is chilly. It's certainly possible that this extends to the hardwood floors inside the apartments. Note Penny's central rug and the pink 'ugg-style' slippers she's seen wearing on several occasions:
Sheldon: There there. [Reluctantly] Would you prefer to wait in our apartment?
Penny: No Sheldon, I’d rather sit on this freezing cold floor sobbing like a three year-old.
It's part of the roommate agreement and he's simply gotten used to it:
We know that Sheldon has a thing about unwashed feet in the shower. It's not a stretch to imagine that he's also against bare feet in the apartment. Wearing socks could simply be a habit for him
Leonard: Did you know that, per our roommate agreement, I have to wash my feet before I get in the shower? And not in the sink. We each have special buckets.
And my personal favourite: Because showrunner Chuck Lorre has a thing about his male characters wearing socks in bed
Alan: Listen to this. "Has anybody had sex with Charlie where he actually took his socks off?"
Charlie: That's just mean. I have bad circulation in my feet.
Why does Leonard on The Big Bang Theory always wear socks when he goes to bed with Penny?
Because naked men wearing socks look funny? Not that we ever see Leonard naked, more's the pity.
Are you 100% sure, he wears socks in bed, like every single time? I don't think that's true any more. Regardless, women will often wear socks in bed because they suffer from cold feet, so perhaps the "socks" is a dig at Hofstadter's physical build; Leonard is after all a nerd, there's nothing macho about him.
Earlier in season 8, viewers discovered Leonard had a deviated septum, in the episode called
The Septum Deviation.
Apparently, sufferers may be unaware that they have this condition, they may mistakenly believe they are particularly vulnerable to head colds, and nosebleeds, they may experience difficulty in breathing—and we all know that Leonard is asthmatic—so, it's plausible that Johnny Galecki's character believes his stuffed up nose, colds and nosebleeds will be exacerbated by having cold feet.
The Weekend Vortex (S5 E19)
Leonard: Hey, listen, I kind of made plans with the guys this weekend, but then I wondered, because we’re in this relationship-beta-test, if I should have asked you first. Then I thought if I did check with you first, you’d think that I was taking things to seriously. And then, then I got a nosebleed
Wikipedia lists the following symptoms of a deviated septum: infections of the sinus, sleep apnea, snoring, repetitive sneezing, nosebleeds, difficulty with breathing, and mild to severe loss of the ability to smell.
Leonard will wear socks and a T-shirt in bed when he is in a hotel and the floor is carpeted...
and when making love to Penny (in this scene he is bare chested, so naked man wearing socks in bed with a beautiful girl = funny)
It's a psychological thing. There is a long-held belief that wearing socks in bed indicates a fear of intimacy. Leonard, while probably the most socially adjusted character on The big Bang Theory, is still portrayed as a nerdish person. As such, they generally have limited social skills and limited partners, and this is a subliminal (possibly too subliminal based on the previous answers given) joke about the stereotypical nerd.