The Chocolate Palace was designed by Willy Wonka for Prince Pondicherry of India. There was some miscommunication between Pondicherry and Wonka regarding the palace's function, as the prince believed that he could live in the palace permanently, while Wonka had intended it to be a temporary extravagance.
Willy Wonka forewarned the prince that the palace would not withstand the intense temperatures, but Prince Pondicherry ignored him, and the palace collapsed, presumably days after its construction. Prince Pondicherry intended there to be a replacement for The Chocolate Palace, but Willy Wonka was preoccupied with hardships within his business and the plans were never carried out.
The story of The Chocolate Palace was present only in the 2005 film, and doesn't play into the main storyline of the film, but rather offers a demonstration of Willy Wonka's brilliance.