Before he married Mary, William investigated the possibility that he should inherit the English and Scottish thrones ahead of Mary or Anne, due to the low birth of his cousins' mother, Anne Hyde. He had some reason to believe that his claim on the thrones was better than theirs.
On the Continent at that time, if a prince married a commoner, it was automatically considered to be a morganatic marriage and any children from the match were not permitted to inherit their father's rank or hereditary lands. The marriage of James, Duke of York and Anne Hyde was shocking to their contemporaries since Anne was recognized as his Duchess. England had no such thing as morganatic marriages. This fact was one of the main reasons William decided to marry Mary.
As for George of Denmark, it is true that he had no claim whatsoever on the English or Scottish thrones, which may have been a factor in the decision not to crown him as king, especially since Anne was already in bad health at her coronation. Another reason was the fact that George was deeply stupid; no one wanted to make him so powerful.
After George deserted him in 1688, James II said that the loss of a good trooper would have done more harm than losing "est-il possible?", as he nicknamed his son-in-law.