The wikipedia page on the flag of Cuba says:-
It is one of the two flags of a currently socialist country (the other being Laos) that does not use any Communist Symbolism.
The symbolism is (from the same page):-
The three blue stripes represent the three departments in which Cuba was divided at that time, the white purity of ideals, the light; the red triangle, originating from the French Revolution - and the three ideals of liberty, equality and fraternity: red for the blood and the courage; the star was the new state that should be added to the United States.
The flag was adopted in 1902 but the Cuban Revolution happened fifty to sixty years later! Why didn't the new regime do away with the flag or add any communist symbolism (same goes for aforementioned Laos) to it to distinguish it from say, Puerto Rico (the design is the exact same but the colours are flipped)? Some of the symbolism is also quite surprisingly contradictory to communism!
Side note:- The current flag was adopted in 1902 but dropped again in 1906 for a flag that is the same, just with a lighter turquoise-ish shade of blue. The current flag was reinstated after the revolution.
Because Cuba wasn't communist at the time.
The flag was designed in 1849 and adopted in 1902. The original design purposely copied French and United States elements.
The Cuban Revolution that brought the Castros to power didn't happen until 1958. This would have been the time to change the flag, if it were going to get changed. However, they actually got a fair bit of help from the US, and in turn insisted they were not Communist in any way. Fidel Castro said this in an interview in 1959 (after he took power):
I know the world thinks of us, we are Communists, and of course I have said very clear that we are not Communists; very clear.
However, once he got to looking at the changes he wanted to make, Communism started to look attractive. Over 70% of Cuba was owned by foreigners, including the Catholic Church. About a month after this quote, Cuba's government started confiscating this land. A year later, they officially confiscated all foreign-owned property. It still wasn't until about 1965 (5 years later) until Castro's party had completely transformed into the modern Communist Party of Cuba.