The visit, which lasted barely three hours, comes as Washington attempts to counter Beijing's efforts to gain influence in the sparsely populated but strategically important Pacific island nations.
Esper said the United States and Palau shared values of freedom "where all countries respect the rules and norms for peace and prosperity of all nations".
"This is especially important today, as we continue work alongside our allies and partners to protect that international system that is under threat from China and its ongoing destabilising activities in the region," he said.
Beijing has enjoyed recent success in the Pacific, persuading the Solomon Islands and Kiribati last year to switch diplomatic allegiance from Taiwan to China.
That left Palau as one of Taiwan's four remaining allies in the Pacific and only 15 worldwide.
The nation of 22,000, which lies about 1,500 kilometres (930 miles) east of the Philippines, has retained strong ties to Taiwan and the United States under Palau President Tommy Remengesau, despite pressure from China to switch.
Remengesau said China had employed "aggressive moves" in the region but he understood why it had won over some island nations.
"It's no secret that they are loaning money and putting money into the economies of many Pacific island nations," he told reporters.
"That has an impact on how people view the relationship with those who help them."
China effectively banned its tourists from visiting Palau in 2018, severing a major income stream in a move seen as retribution over ties with Taiwan, which Beijing sees as part of its territory to be brought back into the fold.
Esper said he and Remengesau had discussed the need to respect "sovereignty of nations of all sizes".
While Palau is an independent nation, it has no military and the US is responsible for its defence under an agreement with Washington.
Under the deal, the US military has access to the islands, although it currently has no troops stationed there.
A US Military radar facility is planned but construction was suspended because of the COVID-19 pandemic, with Palau keen to retain its virus-free status.
Remengesau welcomed US efforts to boost its military presence in Indo-Pacific region.
"It gives us those of us in Palau a great sense of security and a sense of stability heading into the future," he said.
@ Jackie San