Anti-price gouging laws are intended to ensure that people in emergency situations (like Cat 5 hurricanes and raging wildfires) can buy food at normal prices including baby food, medications, water and gasoline/fuel. They are short term restrictions on capitalistic greed. Housing shortages are not "emergencies" within the meaning of anti-gouging laws.
When the government forces people to sell those items at artificially low prices during emergency situations, people buy more than they need, resulting in many people ending up with nothing. When stores are allowed to raise prices to the new market rate (based on supply and demand - falsely called "price gouging"), people limit their purchases to what they need, resulting in more people being able to purchase the items they need. To get around ridiculous "price gouging" laws, store often impose rationing, which doesn't work well because everyone's needs are different. After disasters (during the rebuilding phase), supplies are often unavailable because the cost often exceeds the amount "price gouging" laws allow stores to sell the product, which would cause a business to lose money on each item sold.
I note that Trump is now planning to ban the purchase of single-family homes by corporations which want to use them as rental properties, in order to free up housing stock for home buyers. In a purely capitalistic state, no such law would be implemented, would it?
Capitalism doesn't mean anarchy. Regulations to prevent monopolies or individuals cornering the market are an important part of capitalism.
Capitalism in the US was based on slavery until the Civil War ended slavery. Slavery was the means of production and distribution. It was evil, as you well know. So "pure" capitalism was altered or regulated by outlawing slavery. The capitalism model was altered by legal means for the betterment of everyone.
Capitalism was never based on slavery. Capitalism is the natural way of business, probably since the beginning of time. Slavery was only allowed in southern states. The Republican states in the North that opposed slavery had a better economy. Even in the South, individuals (owners of businesses and plantations) were the means of production and distribution (which refers to who makes the business decisions). Individuals decided what to produce, who to hire, and how much to charge. Slavery meant somewhat cheaper labor, though not much cheaper as business owners had to purchase slaves from their owners in Africa and provide food, housing, and other expenses while they worked for them, which is similar to paying wages indirectly.
Socialistic aspects of the US economy and government enable us to have medical care, fire and police protection, a military, a financial safety net for the poor, public education, and other things.
Under socialism, a big, centralized government would control the healthcare system. The government would hire doctors, set their salary, and determine how much people pay for their services, without individuals having any freedom or input into the process. In the US, Medicare, Social Security, and VA healthcare are benefits that people earn through hard work, not something the government gives away to people who don't deserve it. Forms of welfare, such as Medicaid that you mentioned earlier, is basically forced charity. No one is forced to sign up for it and doctors aren't forced to accept it. While the government used to be more involved, they've found it costs less to hire insurance companies to manage Medicaid benefits, as the profit incentive lowers cost by increasing efficiency. Thus, Medicaid currently operates based on free market principals of capitalism, with private insurance companies setting reimbursement rates and contracting with doctors and hospitals to meet their customer's needs.