Although zěnme 怎么and wèishénme为什么 can both mean ‘why’, they are different in pragmatics. Speakers usually express a weird tone when using zěnme 怎么, as they tend to use 怎么(How come) to ask abnormal things? For example,
Zěnme tiān biànchéng hóngsè le?
How come sky change into red
‘How come does sky change into the red color?’
From the example, we can see that it is abnormal to see the red sky, and therefore speaker tends to use zěnme 怎么.
In addition, there is an interrogative tone when using zěnme 怎么, which means you should not do it. For example,
你怎么打人?
Nǐ zěnme dǎrén
You why hit people
‘Why do you hit others?’