"We are never out of diplomatic solutions," Mattis said before a meeting with his South Korean counterpart at the Pentagon.
"We continue to work together, and the minister and I share a responsibility to provide for the protection of our nations, our populations and our interests."
Trump, who has vowed not to let North Korea develop nuclear missiles that can hit the mainland US, had said in a statement yesterday that "all options are on the table".
North Korea said the launch of an intermediate-range ballistic missile was to counter US and South Korean military drills and was a first step in military action in the Pacific to "containing" the US island territory of Guam.
The 15-member UN Security Council condemned the firing of the missile over Japan as "outrageous" and demanded that North Korea halt its weapons programme.
The US-drafted statement, which did not threaten new sanctions on North Korea, urged all nations to implement UN sanctions and said it was of "vital importance" that Pyongyang take immediate, concrete actions to reduce tensions.
Trump's mention of payments to North Korea appeared to be a reference to previous US aid to the country.
The latest tweet by the Republican US president drew criticism from some quarters in Washington. Democratic Senator Chris Murphy wrote on Twitter: "Bar is high, but this is perhaps the most dangerous, irresponsible tweet of his entire Presidency. Millions of lives at stake - not a game."
Mattis and US Secretary of State Rex Tillerson have emphasised finding a diplomatic solution on North Korea, and have used softer tones than Trump on this and other matters.
Trump's latest tweet was more strident than his remarks last week when he tweeted that "I respect the fact that he is starting to respect us," referring to Kim, and that maybe "something positive can come about".
The US Defence Department's Missile Defence Agency and the crew of the USS John Paul Jones conducted a "complex missile defence flight test" off Hawaii, resulting in the intercept of a medium-range ballistic missile target, the agency said.
Trump and Japanese Prime Minister Shinzo Abe spoke by telephone and confirmed their "continuing, close co-operation" to address Pyongyang's missile launch over Japan, the White House said.
Washington has repeatedly urged China, North Korea's main ally and trading partner, to do more to rein in Pyongyang. Speaking during a visit to the Japanese city of Osaka, British Prime Minister Theresa May called on China to put more pressure on North Korea.
-Reuters, AAP