I don't think this is actually true. Employers don't give a crap about your side projects, what you do in your free time, or what you learn at the weekends. Many don't even want you to learn things in your job. The reason it's so widely believed in our industry is four-fold;
- people who are "Twitter famous" devs often work as developer advocates for businesses, and spend their work days building small projects to demonstrate things. Then they talk about them but never mention that they're work projects. Their audience thinks "I could never get to build that in office hours, must be a side project!" and extrapolate from there that getting to be a rich and famous dev advocate means working on weekends.
- devs involved in hiring say they want to look at Github repos. I've been hiring devs for the last 15 years and while I do look at repos if they're available I still interview loads of people who don't have them. In fact, to be honest, having public repos is more likely to push me to rule someone out rather than arrange a chat. Most people's public repos are examples of very bad quick hacks, starter projects with no additional work, or things so poorly documented I can't even tell what they are.
- we like making side projects and need an excuse to spend time on them. When your partner or kids or parents are nagging you to do something being able to stress that our career will wither away to nothing if we don't spend time on something on Sunday night is useful.
- it's a route out of a bad job. If you're working with tech you don't like, at an employer who refuses to give you a training budget, and you don't have any opportunity to learn things in work time, then side projects are an obvious alternative. A better alternative is to find a job where you can grow. An important thing to note about this is that there are a ton of skills that are really hard to learn at home on a weekend (running meetings, talking to clients, using focus groups, mentoring juniors, writing clear docs, etc). Being a dev is about much more than coding after all.