You mostly talk about money but hardly about the work. Of course, it's reasonable to switch when the money doubles. In the long term I would assume that you didn't spend enough time at those companies to really get to know them (just one or two departments probably).
For your next company I would suggest that you stay longer and learn more about the company, the people, the values, the processes. At some point it's not only about writing code anymore as you move up the ladder. Hopping after 30 or around 5 years of work experience will be a red flag for employers.