As I recall HM Charles II was born to Henrietta Marie of France, who was full sister to HM Louis XIII, who in the fullness of time begat HM Louis XIV who himself may be called the founding grandfather of the present Spanish Royal House (Borbon Y Borbon, if I remember correctly); that would make Don Felipe the heir of a second or third cousin to HM Charles II.
So there is a blood tie, albeit a fantastically-distant one.