TEHRAN — President Hassan Rouhani of Iran lashed out at his hard-line opponents on Monday, saying the protesters who have shaken Iran in recent weeks objected not just to the bad economy but also to widespread corruption and the clerical government’s restrictive policies on personal conduct and freedoms.

“One cannot force one’s lifestyle on the future generations,” Mr. Rouhani said, in remarks reported by the ISNA news agency. “The problem is that we want two generations after us to live the way we like them to.”

In his most extensive comments yet on the protests, Mr. Rouhani said that those people who took to the streets across the country did so because they were seeking a better life. “Some imagine that the people only want money and a good economy, but will someone accept a considerable amount of money per month when for instance the cyber network would be completely blocked?” he asked. “Is freedom and the life of the people purchasable with money? Why do some give the wrong reasons? This is an insult to the people.”

Mr. Rouhani, a moderate, has been seeking a relaxation in social controls, but he faces resistance from hard-liners in unelected power centers like the judiciary, vetting councils and the state news media. They want to keep in place the framework of Islamic laws that effectively dictate how people should live, despite enormous changes in Iranian society in the past decade alone.