Why did Sophie deconstruct and reconstruct the castle?
She “unlinked” the castle from the hat shop so that Howl would not continue to put himself in danger protecting the shop from the bombing. Lacking the magical knowledge which allowed Howl to “move house” with precision earlier, she settles for the ad-hoc solution of destroying the entire setup. Needing to set the castle going again so that she can rescue Howl, she makes her own bargain with Calcifer (giving him her braid), offering him just enough power to run a smaller version of the castle.