CosmoCaixa (Science Museum) is not one of the main tourist attractions in Barcelona, it is more popular with local people. At the same time, there are also tourists who visit it. Since the museum focuses mainly on children – there are a lot of interactive attractions for them, and therefore it is visited by many families with kids.
Moreover, children younger than 16 years do not need to pay (for additional information – Barcelona for Free) and tickets are very cheap (4 Euros, as of 2017). CosmoCaixa is a good option if you want to spend a lovely, yet not too expensive, activity that kids would enjoy (for additional information – Kids and Families in Barcelona).