Why some compounds form different crystal structure at different temperature?
You are just entering into the field of Polymorphism. I couldnt find any source for Why polymorphism occurs but you can think about it as Energetically favorable structure at a particular temperature.  

Related - Why polymorphs form?