Following the financial crisis of 2007-2008, a deep analogy between the origins of instability in financial systems and complex ecosystems has been pointed out: in both cases, topological features of network structures influence how easily distress can spread within the system. However, in financial network models, the details of how financial institutions interact typically play a decisive role, and a general understanding of precisely how network topology creates instability remains lacking. Here we show how processes that are widely believed to stabilise the financial system, i.e. market integration and diversification, can actually drive it towards instability, as they contribute to create cyclical structures which tend to amplify financial distress, thereby undermining systemic stability and making large crises more likely. This result holds irrespective of the details of how institutions interact, showing that policy-relevant analysis of the factors affecting financial stability can be carried out while abstracting away from such details.