I assume that you are talking about Fidel Castro's revolution in the 1950s as opposed to the rebellion against Spain in the 1890s. And I assume you are talking about the Mexican Revolution of the 1910s in which the government of Porfirio Diaz was overthrown. The motives in these two revolutions were similar in that both sets of rebels wanted to overthrow a long-standing dictatorship that had (in many people's minds) been run for the benefit of foreigners and a small native elite.
In both cases, there was a dictator who had ruled for a long time--Porfirio Diaz, who had ruled for over 30 years in Mexico, and Fulgencio Batista, who had ruled Cuba for most of 26 years. Both dictators were seen as people who ruled in ways that were of great benefit to foreigners, particularly business interests from the United States. Both were seen as rulers who helped only a small sliver of their own population.
Because of this, each dictator faced eventual rebellion from people who wanted a government that would be more responsive to the broader population of their country. This desire for a more responsive government motivated both the Mexican and Cuban Revolutions.