The US sanctions are illegal under the international law. However, the Americans do have a right to impose those sanctions because Cuba is very close to the US and serves as a historical importance when looking at the nuclear crisis in the early 60's and 70's. The sanctions are pushing Cuba to make more drastic and logical decisions that will push their country towards a democratic nation in the future.
Ever since the monroe doctrine in the 1800's the US has exerted its dominance in the western hemisphere. The USA chooses the path it follows with respect to its neighbors and local allies. The legality or illegality of the sanctions against Cuba have no bearing on the policies of the USA.