I don't want System Preferences in my dock (not just because of the annoying red badge that keeps showing, I just don't want it). I move it to trash, but every time I open System Preferences again, it pins it back to the dock. I have to 'remove from dock' each time. Why? How do I prevent this?
This area of the dock, separated by the lines, is your recent applications. It will show your three most recent applications, even if they're closed.
If you only want to hide System Preferences and not disable the feature entirely, you will need to open other applications (at least three) and System Preferences will be replaced.
Alternatively, you can hide this area of the dock in the Dock preferences. It is a checkbox called "Show recent applications in Dock.":