The Fairytale Castle is a building that can be bought from the Epic Items section of the Merchant Chest for 9,950 Magic Beans. Only one can be build per person.
The building produces Magic Beanstalks, but only when it has been fully upgraded to Level 5. At this level it will convert 25 Magic Bean into 5 Magic Beanstalks every 10 minutes.