The US trades with many socialist countries, China, Venezuela, Vietnam, etc.
The reason why there is an embargo with Cuba is after the revolution in 1959, Fidel Castro nationalized (seized control of) all the businesses in the country in the name of communism, including assets that were owned by the US government, US corporations and American businessmen. This outraged politicians and corporations and they initiated the trade embargo in protest.
In 1996, Clinton signed the Helms-Burton act which penalized other countries that continued to do business with Cuba, which caused international outrage since the US was now dictating the trade policy of other nations (which, duh, what else is new...)