Most countries are involved in scores of such organizations/treaties/informal groups. Maybe they find it easier to negotiate on some topics in one particular configuration, wanted to have a forum to coordinate with (or exert influence on) countries that weren't part of the other groups or found that the previous efforts stalled.
BRICS in particular is a very different beast than the SCO. It's simply a name and a series of summits with no permanent organization, structure or legally binding agreements. The countries involved are on different corners of the globe and actually not collaborating that well together. Being part of this loose group is certainly not a reason for China not to work with its neighbours (and Kyrgyzstan, Tajikistan, or Uzbekistan obviously weren't going to be invited to the BRICS summit so another forum was necessary).
It's a bit like the US being a member of the WTO, NAFTA, APEC, G20, etc. and neogotiating the TTIP and the TTP. But there are countless other examples.