It is for the same reason they hump your leg; they are in heat or overstimulated. When you engage your dog is too much play, the excessive stimulation can cause them to hump pillows or blankets; something cats are good at. Consider neutering your dog to stop the humping problem.