They spied on everyone. This started before they knew that Trump would be the GOP candidate - and I'm sure they thought Trump had no chance of getting the nomination. Papadopolous was in the Ben Carson campaign before he latched on to the Trump campaign (he also worked in the State Dept. during HRC's tenure). Obama and Co. had 8 years to fill the swamp with dirty and devious people, and I'm sure they took full advantage of that opportunity.
And Trump still won.