I think Q did the right thing for the right reason. If he can see into the future, and I think he can, then he saw the Dominion War not too far in the future. So his motives not only helped with future dealings with the Borg, but also prepared Starfleet for other galactic threats as well..