Why did the US invade the bay of pigs?

The US invaded the Bay of Pigs because they wanted to provoke an uprising against Castro. Their invaders were Cubans who had become American citizens, so it would look like Cubans were having a rebellion against their own government, and that the US wasn't involved.