Governments not only set rules about some aspects of what can be sold, they create laws enabling those who do not receive what they were led to believe they were purchasing to sue for fraud or one of several other crimes. In the late 18 th century and early 19 th century when capitalist ideas were being formed, a great deal of land in many parts of the world was publicly owned. There had to be some way to convey public land to private individuals who wanted or needed it. Governments had to create ways to convey these lands to people. The state has to provide some minimal level of collective capital or public goods to facilitate the development of markets when no single individual or firm can afford to do so.
Roads are an obvious example.
There must be a labor force available to those who wold produce goods and services for the market. Governments participate in the creation of labor in a number of ways of which requiring some minimal level of education is one of the most obvious. Governments have a role to play in allocating responsibility for what happens in the market. We define some types of transactions as criminal. But most market transactions take place outside what is defined as criminal.