WASHINGTON — Defense Secretary Jim Mattis has sharply criticized Pentagon officials for spending up to $28 million over budget to help the Afghan National Army buy camouflage uniforms because of the sartorial tastes of a single Afghan official.

Mr. Mattis’s harshly worded memo to the Pentagon’s acquisitions department, released on Monday, followed a report last month by the Special Inspector General for Afghanistan Reconstruction. It concluded that the Pentagon needlessly spent millions to license a proprietary camouflage pattern that replicates lush forests.

While such a design might work in the tropics, most of Afghanistan’s landscape is desert.

The Defense Department already owned dozens of desert camouflage patterns it could have used for free, said the report by the United States’ government watchdog in Afghanistan. It noted that the former Afghan minister of defense liked the forest camouflage.