Why do compounds with similar properties have different Stitch IDs?
Bethamethasone and dexamethasone are different chemicals, hence they behave different, therefore they have different identification numbers. The numbers you cite are not STITCH IDs, and as far as my research goes these do not exist. Instead they are CID - PubChem Compound Identification numbers. 

 

As you can see the molecules are diastereomers. The stereo centre of the steroid differs at carbon-16. When you look them up with STICH 4.0 you will see differences with their predicted functional partners. While the first one is nearly identical, the second partner for betamethasone is proopiomelanocortin, while for dexamethasone it is ABCG2.

For more information on STITCH (‘search tool for interactions of chemicals’) I recommend: Michael Kuhn, Christian von Mering, Monica Campillos, Lars Juhl Jensen, and Peer Bork, Nucl. Acids Res. 2008, 36 (Database issue): D684–D688. (Open Access); PMCID: PMC2238848.

Image sources:


National Center for Biotechnology Information. PubChem Compound Database; CID=9782, https://pubchem.ncbi.nlm.nih.gov/compound/9782 (accessed Apr. 20, 2016).
National Center for Biotechnology Information. PubChem Compound Database; CID=5743, https://pubchem.ncbi.nlm.nih.gov/compound/5743 (accessed Apr. 20, 2016).