BEIJING — Zhou Yunfei, a technology executive who owns a villa in eastern China, did not have much in common with an impoverished farmer more than 500 miles away who was convicted of murdering a village chief with a nail gun.

But when Mr. Zhou heard last week that the Chinese government had executed the farmer, Jia Jinglong, he was furious. He saw it as a sign that the ruling Communist Party was imposing harsh punishments on the most vulnerable members of society while coddling the well-connected elite.

“The legal system isn’t fair,” Mr. Zhou, 57, said, adding that local officials had “turned against the common people.”

President Xi Jinping has made restoring confidence in Chinese courts a centerpiece of his rule, vowing to promote “social justice and equality” in a legal system long plagued by favoritism and abuse. Since coming to power in 2012, he has led a high-profile campaign against corruption, ensnaring thousands of low-level officials and even some of the party’s most senior leaders.