Before the revolution Cuba was a fairly stereotypical modestly corrupt semi-colonialized nation. What I mean by that is that foreign powers, in this case the US specifically, dominated the economic landscape and operated exploitatively and with more or less impunity toward the letter of the local law. You see a similar situation in, for example, pre-revolution China during the 19th and early 20th centuries.
Specifically you have the Republic of Cuba, which was effectively a client state of the US. You have many major business interests in Cuba (sugar, hotels, casinos, oil refineries, manufacturing) owned by US citizens or corporations. When Castro came to power he nationalized all foreign owned businesses, effectively taking away billions of dollars in wealth from US owners. The US government requested compensation for the confiscated property, and received effectively IOUs (Cuban government bonds due in 20 years). On top of that Cuba very quickly veered toward Communism, both ideologically and geopolitically, by instituting Communist policies and programs and by establishing cozy relations with both China and the Soviet Union (as well as hosting Communist leaders and thinkers from throughout Latin America).
Additionally, anti-American sentiment coming from the new Cuban government would grow by leaps and bounds. First US military forces that had been present in the Republic of Cuba (separate from those in Guantanamo) were asked to leave. Then plantations were nationalized (as above). Then tensions around oil refineries reached a peak and Castro nationalized US owned refineries. This caused the US to end formal diplomatic ties with Cuba and impose a trade embargo. Then in early 1960 a ship filled with Belgian munitions exploded in Havana harbor. Castro publicly blamed the CIA for the explosion.
In the context of the Cold War and the ideologically charged geopolitical fight between Communism and Capitalism the Cuban revolution was one front line. The US had regarded Cuba as effectively its back yard, a cozy neighbor that was in its pocket, the revolution and the shocks of nationalized Cuban property and industry was ideologically traumatic, especially for the American government. You have to keep in mind that the 1950s was also the period of time that saw the initial massive escalation of the Cold War: the mass deployment of nuclear weapons; the advent of nuclear bombers on constant alert; the advent of long range nuclear armed missiles (first cruise missiles then ICBMs); the advent of MAD as a doctrine; the extension of the Cold War into Earth orbit; the "red scare" and anti-communist witch hunts in the US; the Korean war; the Berlin blockade and airlift; the suppression of the Hungarian revolution in 1956; the building of NATO and the Warsaw Pact; the participation by Communist forces in many revolutions against imperial powers throughout Africa and Asia; and so forth.
In that context the stakes for the US not just "losing" Cuba but having Cuba "taken" by its current mortal enemy made it effectively impossible for the US to deal with the situation with any sort of poise or magnanimity. Relations between the US and Cuba quickly and thoroughly soured through 1960 and it is in this context that the plan to depose Castro was developed.
Cuba was seemingly a backwater power with Castro having a very insecure hold on power in the country, it seemed to some in the US that it would not take much effort to topple him, so Eisenhower ordered plans to do just that put together.
Also, it should be noted that the CIA had a long history in effecting regime change throughout the world. The Bay of Pigs invasion wasn't exactly a special effort it was just one more in a long line of similar plans, many of which had achieved their desired goal with far fewer resources.
In short: Castro "triggered" the US to plan a counter-revolution by confiscating US property and businesses without compensation, effectively ending US influence on the island, being overtly Communist and maintaining close diplomatic ties with America's most dangerous geopolitical adversaries, and finally by becoming overtly hostile toward the US.