It is done mostly for fun as most people know that royal-to-royal marriages are very unlikely to happen these days. Gabriel just happens to be an ideal match for Leonor in a royal-to-royal marriage scenario because he is a Catholic prince from an extant nuclear royal family without drama or baggage, and is also of the right age for her and tall/handsome.
To be frank, there is also another consideration that may be not politically correct to mention. Gabriel (most likely) would have become king (eventually) if the constitution had not been amended in Belgium to introduce equal primogeniture. Although the change happened long before Elisabeth or Gabriel was born, many people might still feel that, if he can no longer be king, a reasonable compensation would be for him to become a prince consort in some other kingdom. It may sound terribly sexist, but it is no different really from daughters of monarchs (especially eldest living daughters) being married in the old days to heirs to other thrones or foreign monarchs to become queens consort. Gender equality should work both ways if you think about it.
EDIT: Note that, in Spain in particular, the position of consort to the monarch is not inconsequential because, constitutionally, if the monarch's heir is still a minor, the consort is the default regent, not only if there is a demise of the Crown and a succession, but also if the monarch is incapacitated or somehow unable to function as head of state. In other words, in a normal scenario where the royal couple has a child of their own, there is an 18-year window in which the consort might be called to serve as acting head of state. Gabriel, given his military training and princely background, would be well suited to take over as regent in such scenarios.