Bletilla striata (Thunb.) Rchb.f. is a perennial herb belonging to the Orchidaceae family. Its tubers are used in traditional Chinese medicine to treat gastric ulcers, inflammation, silicosis tuberculosis, and pneumogastric hemorrhage. It has been reported that different soil types can affect the growth of B. striata and the accumulation of secondary metabolites in its tubers, but the biological mechanisms underlying these effects remain unclear. In this study, we compared agronomic traits and the accumulation of secondary metabolites (extractum, polysaccharide, total phenol, militarine) in B. striata grown in sandy loam or sandy clay soil. In addition, we compared physicochemical properties and microbial communities between the two soil types. In pot experiments, we tested how irradiating soil or transplanting microbiota from clay or loam into soil affected B. striata growth and accumulation of secondary metabolites. The results showed that sandy loam and sandy clay soils differed significantly in their physicochemical properties as well as in the structure and composition of their microbial communities. Sandy loam soil had higher pH, SOM, SOC, T-Ca, T-N, T-Mg, T-Mn, T-Zn, A-Ca, A-Mn, and A-Cu than sandy clay soil, but significantly lower T-P, T-K, T-Fe, and A-P content. Sandy loam soil showed 7.32% less bacterial diversity based on the Shannon index, 19.59% less based on the Ace index, and 24.55% less based on the Chao index. The first two components of the PCoA explained 74.43% of the variation in the bacterial community (PC1 = 64.92%, PC2 = 9.51%). Similarly, the first two components of the PCoA explained 58.48% of the variation in the fungal community (PC1 = 43.67%, PC2 = 14.81%). The microbiome associated with sandy clay soil can promote the accumulation of militarine in B. striata tubers, but it inhibits the growth of B. striata. The accumulation of secondary metabolites such as militarine in B. striata was significantly higher in sandy clay than in sandy loam soil. Conversely, B. striata grew better in sandy loam soil. The microbiome associated with sandy loam soil can promote the growth of B. striata, but it reduces the accumulation of militarine in B. striata tubers. Pot experiment results further confirmed that the accumulation of secondary metabolites such as militarine was higher in soil transplanted with loam microbiota than in soil transplanted with clay microbiota. These results may help guide efforts to improve B. striata yield and its accumulation of specific secondary metabolites.