They didn't achieve their goal, because Canada won the defense and counterattacked in direct response. Burning Washington was victory enough, all things considered, given the US were the aggressors.
It was a bad decision and an embarrassment to the United States.
Canada had no intent for war. And they succeeded in their defense and then turned the tides. The US didn't have to be conquered for them to lose. They suffered enough defeats along the way that it was blatantly clear their invasion failed - ergo, they lost. Again, Canada & the Brits had no intent for war. The aggressors failed. The defenders succeeded.