The Rubik’s Cube was Originally Built as a Structural Problem
The Rubik's Cube was created by Erno Rubik in 1974, but it was never meant to become the popular puzzle it is today. The most of his life had been devoted to architecture, and Rubik was a bit of an oddball. Though he was also an inventor, his areas of competence were architecture and education.
While some accounts describe Rubik's search for a tool to educate his students how to interact with three-dimensional things and you can even read this explanation on his Wikipedia page, Rubik disagrees.
Rubik himself stated in an interview that while he did show his students the cube, he didn't make it specifically to instruct them in anything. He created it for himself as a tool to help him visualise a structural issue. He was interested in learning how to move the individual blocks of the cube without causing the entire structure to crumble since he appreciated geometric shapes.
It was never intended to be a toy or game; rather, it was for his own interest. To make it simpler to monitor his progress, he added coloured squares, but when he mixed it up, he realised he had made a puzzle that would be exceedingly challenging to solve.