If the devil drives you, you have no choice but to go, or in other words, sometimes events compel you to do something you would much rather not.
Shakespeare uses it in All�s Well that Ends Well: �My poor body, madam, requires it: I am driven on by the flesh; and he must needs go that the devil drives�.
It is an even older expression first seen in John Lydgate�s Assembly of Gods, written about 1420: �He must nedys go that the deuell dryves�.