Salt works to kill slugs by using the osmosis they depend on to survive to dehydrate them of the water that is within their body. Slugs depend on osmosis because they pick up water from areas surrounding them to hydrate themselves.
A slug relies on the slime it secretes to be able to move, eat, function and continue living. This slime is made up of mostly water, but has some small amounts of salt within it. The concentration of the water in the slime is nearly perfect for the slug's body. The slug continuously keeps itself hydrated and keeps its slime functioning properly by picking up water from surrounding areas; this practice is known as osmosis and happens in many living things, but is mostly prominent in smaller cells.
When there is salt in the water, the slug will pick up the water without knowing that it is different from other water. It can also simply pick up the salt by gliding over it. Salt that comes into contact with the body will begin dehydrating it immediately and will cause the water to move to where this is more water; in this case the water will move to the world outside of the slug's body. The salt will essentially take over and there will be very little water remaining in the body, leaving the slug dehydrated to the point of death.