In O”C 153 S’ 1 it is mentioned that a congregation is permitted to transform a Synogogue into a Beis HaMedrash (Study Hall). While commenting on this ruling by the Shulchan Aruch, the Mishna Brura (S”K Aleph) mentions that the reason for this is only because the level of Kedusha in a Study Hall is greater than that of a Synagogue. Acknowledging the reasoning of the MB, the Shaar Hatzion nevertheless emphasizes that the community should still try to the best of their ability to continue maintaining the Synagogue, and try to raise money for the building of a new Study Hall.
Piskey Teshuvos nevertheless suggests that when the Shulchan Aruch says that a Synagogue may be changed to a Beis Medrish it need not continue as a place of prayer. He also mentions that the declaration of the Mechaber was strictly on the condition that the “new” Study Hall is a place of assiduous study.
Nowadays however, the theory of the S”A as to why the Synagogue is permitted to transform may no longer be valid. Fore nowadays Study Halls are not only used for learning, but they are also utilized as all purpose rooms (ex. Learning, eating, sleeping, and idle chatter) (This is obviously assuming that kedushas beis Haknessess is midrabanan). The utilization of Shuls on the other hand is strictly for prayer services. Therefore if one were to transform the Synagogue into a Beis Medrish the structure would in actuality be moving down in kedusha. All of this being said, nowadays, it is possible that it is prohibited for one to convert a Synagogue into a Beis HaMedrash.