The legal justification for Desert Storm was UN Security Council Resolution 678, which authorised states to use "all necessary means" to remove Iraqi armed forces from Kuwait.
u/Jan_van_Bergen has written an answer about why the United States did not pursue the removal of Saddam Hussein's government from Iraq.