Why do the cubes in my Rubiks cube move into each other?
You have nine separate objects selected, and "Add Keyframe" made animation curves for each object. Because they are separate, each goes it's own way, on separate lines. You can see the orange dots moving on their own straight lines, instead of a circular path.

To fix this:


Clear the current curves.
Bind the objects to a shared parent while keeping their offsets.
Animate the parent only.




EDIT: You say in your comment that you will be animating more rotations. For that case I have two ideas:


Easy mode: move the object centers to the cube center, so all orange dots will be in the same global position. Then rotation along the three axes will move the meshes along a circular path.
Advanced mode: Python script as driver for object position and rotation. This is harder to set up for beginners, but it can result in a shared controller for all 26 objects.