An improved immersed boundary method for turbulent flow simulation on a Cartesian grid is proposed. To determine proper boundary conditions, the near-wall approximation of the mean-flow equation and the Spalart-Allmaras turbulence model are discussed. Then, a manufactured near-wall velocity profile is derived, which is linear with respect to the distance from the wall and which can be resolved by a numerical scheme with second-order spatial accuracy. Corresponding to the modification for the velocity, the eddy-viscosity profile is also altered to maintain the balance of the shear stress. To obtain the manufactured profile as a numerical solution, the immersed boundary method and the damping function in the Spalart-Allmaras turbulence model is modified. Verification cases based on the NASA turbulence modeling resource are conducted. The results with the modified immersed boundary method show close agreement with the reference results with body-fitted grids. Finally, a transonic flow around the NASA common-research model is simulated to show the capability of the modified immersed boundary method for three-dimensional problems.