Glucose is such a ubiquitous energy storage molecule, that we show the simple photosynthetic chemical equation to include the capture of six CO2 molecules to create one glucose molecule. However, the steps specific to photosynthesis, the light-dependent and light-independent reactions, don't produce glucose directly. Instead, they produce an intermediary molecule, the 3-carbon D-glyceraldehyde 3-phosphate (G3P), which can directly enter the general metabolic cycle, which includes gluconeogenesis. Gluconeogenesis includes a pathway from G3P to glucose.
So, photosynthesis itself doesn't produce glucose, but can be considered to add to the production of glucose because it is integrated into ubiquitous metabolic cycles.
There are existing hypotheses as to why glucose is so ubiquitous. One hypothesis is that glucose is less likely to nonspecifically interact with proteins than other molecules of its kind (aldohexoses) because it is more stable in its cyclic form (instead of the open-chain form) compared to other aldohexoses. Another hypothesis is that β-D-glucose has all five of its hydroxy groups in the equatorial position, making them more accessible to chemical modification, such as esterification, acetal formation, and linkage into polysaccharides.