Why were miners still mining BTC at times when BCH was 2-4x more profitable to mine?
Some miners may be ideologically opposed to BCH and thus will not mine it or help it in any way. Others may be too lazy to switch their hash rate to BCH or do not trust any BCH mining pools so they do not switch. Yet others may simply have been unaware of these profitability spikes and were not available to switch their mining hardware to BCH. Given that the change in profitability was only for a very short period of time, some miners may not have had the time in order to switch their hardware, or the effort was not necessarily worth it.

Additionally, mining on BCH means that they would be mining a much less liquid currency. BCH does not have nearly the same trading volume as Bitcoin and mining BCH means that the miners may be stuck with a coin which they do not want and may even lose value compared to what they would earn with Bitcoin.

It is important to note that even if not all miners switch, some still did which you can see in the hashrate charts. This did happen fairly frequently as the EDA could be gamed so that mining on BCH briefly was more profitable than Bitcoin, and several miners did do this.