Quoted By:
Because the Pokemon universe's foundations are shaped like a double helix, attempting to interfere with one spiral (Dialga and Palkia) disturbs Giratina (the second spiral) and summons it from the distortion world to put a stop to it.
>then why didn't he appear in Diamond and Pearl?
Because the lake guardians are able to control either Dialga or Palkia, but not both at once.
This is all directly stated in the game.