I'd say the idea and demand comes from Putin. Trump is not aware of USA's extensive abilities to use bases in Greenland.
Putin recommended to "his pal" Trump that this should be done. He presented it as a _price,_ for ending weapons supplies to Ukraine, and Trump thinks USA is getting Greenland from Russian SOI as a _compensation_ that is a part of a *deal*.
That's all there is to it. Further background does not exist. Rest of Trump's reasoning is retroactive.