Recent technological advances in medical diagnosis have led to the generation of high-dimensional datasets. The presence of redundant and irrelevant features in these datasets can have adverse effects on the performance of machine learning (ML) methods and reduce the accuracy of their results. Therefore, feature selection (FS), i.e., a popular preprocessing method in ML, is used to select the optimal subsets of features to improve the accuracy of ML methods. This performance enhancement is more crucial while addressing high-dimensional medical issues. Since FS is a multiobjective binary optimization problem, it is necessary to develop efficient FS algorithms. Although metaheuristic algorithms (MAs) have been widely used for FS in medicine, they face different challenges in most applications, e.g., a lack of sufficient effectiveness and scalability to select the most effective features in small and large medical datasets. The cat and mouse-based optimizer (CMBO) is a novel MA based on the natural competitive behavior of cats and mice. Despite its acceptable performance in a variety of problems, the CMBO faces various challenges such as limited exploitation abilities, an unbalanced search mechanism, and high fluctuation in solutions to complex problems, e.g., FS. This paper proposes a modified and binary version of the CMBO called the BMCMBO to enhance the performance in selecting effective features from medical datasets. The BMCMBO involves significant modifications to the method of updating the positions of search agents, the method of selecting mice, the effect of the positional information of the most optimal member of the population, and the addition of the adaptive step size. These modifications are meant to improve the exploitation abilities, boost the accuracy of the solutions, and balance the search process when dealing with the FS problem in medical datasets. The performance of the proposed algorithm on 12 real medical datasets was compared with the performance of the most effective MA and CMBO variants. The statistical results demonstrated that BMCMBO was more effective than other evaluated methods. In addition, the BMCMBO algorithm was employed to select features and diagnose COVID-19 in a real case study. The proposed algorithm identified healthy and infected COVID-19 correctly samples with an accuracy of 98.4\%, demonstrating its superiority.