BEIJING—A senior Chinese official offered the government’s fullest defense so far of its mass detention program for Muslims in China’s far west, saying it formed a bulwark for social stability and suggesting the detentions are voluntary.

In a lengthy interview published Tuesday by the government’s Xinhua News Agency, the chairman of China’s Xinjiang region, Shohrat Zakir, portrayed the camps as generously equipped vocational schools that are vital to a crackdown on religious extremism. He said the clampdown helped bring an...