Goku went SSJ2 against Black because that's the form Trunks uses against Black and he wanted to gauge Black's power. He even asked Trunks after the fight if Black was about that strength in the future.
It's stated that Goku was screwing around during the fight. Imo lol