The design and optimization of a surface plasmon resonance (SPR) biosensor for very sensitive detection of Mycobacterium tuberculosis is presented in this work. Using the transfer matrix method (TMM) as the primary approach, simulations using finite element technique (FEM) verified the results of the sensor. By means of materials such as the N-FK51A prism, TiO2, Si, BaTiO3, and black phosphorus (BP), the sensor achieves a high sensitivity of 540.67 deg./RIU by optimizing layer thicknesses. Further performance metrics were evaluated, encompassing Full width at half maximum (FWHM), signal-to-noise ratio (SNR), and quality factor (QF). The peak QF attained is 133.30 RIU−1, peak SNR came 1.031, but the lowest FWHM recorded is 3.6740 deg., indicating precise detection capabilities. The biosensor can identify refractive index variations within the biological range of 1.29 to 1.35, suggesting extensive use for disease detection. A comparative analysis demonstrated that the suggested sensor surpassed current designs, particularly regarding sensitivity when utilizing BP. This study highlights the significance of material selection and layer thickness in the development of SPR biosensors for practical biological applications, enabling accurate and rapid TB detection.