为了 + [verb phrase] / [noun] + ,[subject] + [verb phrase]
[subject] + [verb phrase] + 是为了 + [verb phrase] / [noun]
为了 gives the goal of an action. The purpose comes first, with 为了, and the action that serves it follows.
The purpose can be a noun: 为了 + person is "for the sake of" them.
English puts the purpose last: "I came to Beijing to study Chinese". Chinese can do that only with 是为了: the action, then 是为了, then the goal.
为了 looks forward to a goal; 因为 looks back at a cause. Something that happened to you, like rain or illness, is a cause.
A negative goal works with 为了不: "so as not to".