A dimethylamide anion is a highly active nucleophile, which makes it a bad leaving group. Remember that the two alkyl groups are electron-donating, thus destabilizing the negative charge on N. (blue mechanism favored)
However, in the case of a Weinreb amide, the oxygen atom adjacent to the nitrogen atom decreases the electron density on nitrogen, so that the attack from the nitrogen atom becomes unfavorable. MoreoverThe reaction intermediate enclosed in the box is stable due to the oxygen atom of the methoxylamide coordinating to the aluminium atom. After hydrolysis, the methoxylamide anion becomes a much better leaving group, due to the oxygen atom stabilizing the negative charge. (red mechanism followed)