Because leetcode is way more boring than making things? Also you learn a lot more by trying to do a good job and working with smart people, they are just not that easy to bring out in an interview.
That being said if you think it’s right for you, go for it.
Because it's not the latter that gets you the next job in many cases.
After you've been in the industry for a while, you are likely to be referred for jobs by former colleagues, or even invited by those former colleagues to come and interview at their new companies. If you excel at your job, your former colleagues will be more likely to do this. They very likely have no idea how good you are at Leetcode-style problems.
At which point you’ll have to do leetcode problems in the interview you got via the referral.
Former colleagues in most cases can just get you out of the application lottery - that’s it.
This is less true in PMish roles where there really isn’t a technical leetcode style interview or at the exec level where the friend is the hiring manager or ultimate decider.
In most cases though? Leetcode still gets you the job.