Before the launch, the momentum of the (spacecraft + asteroid) was zero. So after the launch, the momentum of the (spacecraft + asteroid) has to be zero.
Momentum = (mass) x (velocity)
Momentum after the launch:
Spacecraft: (1,000 kg) x (250 m/s) = 250,000 kg-m/s
Asteroid: (mass) x (-25 m/s)
Their sum: 250,000 - 25(mass) .
Their sum must be zero, so 250,000 kg-m/s = (25 m/s) x (mass)
Divide each side by 25 : 10,000 kg-m/s = (1 m/s) x (mass)
Divide each side by (1 m/s) : 10,000 kg = mass