1. Purpose: derivatives serve primarily as risk management instruments. Gambling serves pure profit and entertainment.
2. Topics: derivatives focus financial assets, commodities and economic risk. Gambling focuses on micro, generally sports, events.
Obviously you could make an argument that both instruments can be used for both purposes.
If I'm a worker at a football team who's job depends on my team qualifying to the Uefa Champions League, betting on my team not making it can be considered risk management.
In the same fashion futures on oil prices can be equally used for pure profit and entertainment purposes.