This depends, to some extent, on what counts (in your mind) as a restraint of market freedoms. If you use that phrase broadly enough, the best-known time when this happened was during the New Deal.
During the New Deal, the government intruded into the economy in ways that had never before been allowed. They paid farmers not to farm, for example. They created, under the NIRA, codes that dictated how businesses had to treat their workers. These things can be seen as restraints on the freedom of the market. The whole purpose behind those actions was to restore economic security.
You could also look at WWII in a similar way. During that time, the government severely limited market freedoms. This was done most prominently through the program of rationing all sorts of goods like rubber, gasoline, and various kinds of food. This was done to ensure the military security of the country by making sure that the Armed Forces had enough materiel to fight the war.