After Suneo bragged about having a ranch, Nobita was asked whether or not he has one, pressuring him to say yes. Doraemon won a number of lotteries for useless planets in the belt between Mars and Jupiter. When Suneo and the rest came to see the ranch, Nobita happened to read the last of the lottery number to the go-anywhere-door, leading them to a huge dreamlike area. As Nobita's toy horse pranced around because of the wind-up life gadget, Suneo and the others became interested in doing the same to their toys and let them live in the area. So they decided to make their own clockwork city.
(Source: ANN)