In this paper, we consider a matroid generalization of the hospitals/residents problem with ties. Especially, we focus on the situation in which we are given a master list and the preference list of each hospital over residents is derived from this master list. In this setting, Kamiyama proved that if hospitals have matroid constraints and each resident is assigned to at most one hospital, then we can solve the super-stable matching problem and the strongly stable matching problem in polynomial time. In this paper, we generalize these results to the many-to-many setting. More specifically, we consider the setting where each resident can be assigned to multiple hospitals, and the set of hospitals that this resident is assigned to must form an independent set of a matroid. In this paper, we prove that the super-stable matching problem and the strongly stable matching problem in this setting can be solved in polynomial time.