In the context of rapid development, Beijing, the capital of China, is facing huge challenges in providing fair healthcare resources to residents. Although Beijing has the best healthcare resources nationwide, a highly concentrated population and uneven distribution of hospitals make the supply of medical resources tight and unbalanced. The objective of this study is to explore the healthcare resource inequality in Beijing based on spatial accessibility. The two-step floating catchment area method was improved to measure healthcare accessibility by defining a novel distance attenuation function that conforms to the specific travel behavior of taxies to hospitals. We explored the inequality among different places and different populations. It was found that the spatial inequality of healthcare resources was evident and typical, with the dominant resources concentrated in the city center. Some regions are always in an advantageous position regardless of traffic conditions. The impact of some social-economic factors on healthcare accessibility was analyzed, which exhibited significant spatial heterogeneity. Hospital deserts for different vulnerable populations were identified. Besides children with massive hospital deserts at the city fringe, other vulnerable populations have no distinct disadvantage. These results offer profound comprehension of healthcare inequality to assist in healthcare resources management and policy-making in Beijing.