Animation Trouble

I’m attempting animation for the first time and have encountered a problem.

I am trying to rotate a crate onto it’s side i.e. falling over, and I found that when i rotate it all the different pieces rotated at weird angles so it sort of fell apart and then reformed. To counter this I joined all the objects. The animation was then fine but my materials went messed up and merged together. How can I counter this?

Some .blend will make situation more clear.