*Asterisk because the question could really apply to any prominent historical figure before modern ideas of sexual identity
So, the question of Frederick the Great's sexual preferences is perhaps surprisingly frequently-discussed, though sometimes light on details. I'm aware that he lived in an era with an understanding of identity and its interaction with sexual behavior that is different from our own, and I'm am aware of the events of his life taken as signalling one way or another. I'm frankly far less interested in the answer to the question of Frederick's sexuality itself than the broader aspect: does it matter what a premodern historical figure's sexual identity might be by our modern standards?
My first instinct is no: there's no point in retroactively imposing modern ideas of sexual identity on historical figures, no more than it would be reasonable to ascribe notions of nationhood onto the first farmers of the neolithic. But I'm also aware of accusations of "erasure" in academia, and accusations that there exists some effort, conscious or no, to diminish or downplay the contribution to history or presence of individuals who fall outside heteronormative boundaries. Given that some of these individuals are used as by various ideological groups as exempla for idealized or heroic character within a heteronormative framework (Frederick himself being an example, as the idealized Prussian/German warrior in the late 19th and 20th centuries) it feels like there's some real consequences there.
So, ultimately, from the perspective of academics/historians: does it matter whether or not 'X' historical figure would be considered gay by contemporary standards? If it ever does, when does it?
Does anything matter? In one sense, it's a reductionist philosophical question that would be out of place answering here.
It's probably not of any "profound" importance whether Friedrich the Great would have been gay by contemporary standards, in no small part because being "gay" and even homosexuality in general are themselves socially and historically conditioned, and there are people today participate in same-sex relationships even though they reject "gay" and "homosexual" as labels: that's why contemporary literature on the subject usually refers to "men who have sex with men" as a more neutral and objective description (even though it isn't perfect, for example consider gay asexuals); see also "same gender loving".
But in the same way I think it does matter, in the first place because all history must be understood from a point (or several points) of view, and therefore whether Old Fritz was gay according to contemporary standards matters because we cannot understand any historical figure's sexuality except through the lens of our own culture. (Even by saying, we wish to examine someone's sexual relationships only through their own words and actions, in the first place the notion of difference implies a place of reference, something to differ from, and in the second that is also a contemporary standard at play.) You can, at best, present the evidence as best you can and leave the audience to draw conclusions. But even when left implicit, the question is still there and won't go away.
The idea that the portrayal of someone as being one way or another can have consequences is valid, but it's also a subsidiary question and one that leads to chicken-and-egg arguments: is hostility towards homosexuals driven even in part by the (apparent) lack of revered homosexual people in the historical record, or is the absence of positively-viewed homosexuals in the historical record because of censorship due to hostility toward homosexuals?