Ideally they wanted it to fix their planet, and/or make a new one for themselves to live peacefully. Destroying it was a last resort only if they couldnt defeat the Decepticons.
however, what i didnt understand is what exactly Sam did to Megatron with the allspark... they never really explained how a human figured out how to use it in any way.
yea, i never understood why go to a city, with lots people and milfs w/ baby carriages...for what?
and why did the all spark turn everything it brought to life evil?
Optimus told sam that if he failed to beat down megatron, sam should put the allspark into Optimus' chest and he would sacrifice himself. So Sam just decided to sacrifice Megatron instead. The power of the allspark must overload them somehow