Both are correct because they both mean "Why". However, they have different usages.
This is the most used and also most generic form of "why", which asks for reason of the situation. As some have realized, there are more than two distinct forms of asking 为什么 in a question, for instance:
- 我为什么有打电脑？ (Why did I play the computer?)
- 为什么我有打电脑？ (Why did I play the computer?)
- 我有打电脑，为什么？ (I played the computer, why?)
Even though the third sentence used 为什么, 为什么 refers to 我有打电脑.
This is the reciprocal form of "why" because of the particle 呢. 为什么呢 is used at the end of the sentence when expressing directly about the "third-party" object. For instance,
I played computer. Is this why?