Barcelona won its second straight Spanish league title when Mallorca beat final challenger Valencia 2-1.