The first color in the indexed palette will be the background color. You can use a program like IrfanView to edit the palette of a sprite. Just swap the first color with your background color.
Also, you should copy the sprite in paint before you edit the palette and then paste the sprite on top of itself after the palette is fixed.
If that didn't make sense I'm sure you can find a tutorial explaining it lol.