It only offered very limited military support. You entirely ignore that Castro came to power under a different pretext than communism but Cubans only learned this too late. Unfortunately Kennedy didn't give the air support needed. Cuba could have been in much better shape today.
Don't compare an authoritarian regime sending militias to conquer the territory of a democratic country to a democratic country training and supporting exiles to get rid of their tormentor. Intent matters.