Broadly in agreement with thegreenheartofmanyroundabouts here regarding Deuteronomy 28.
In 597 BCE, c. 587 BCE, and c. 582 BCE (according to wikipedia), Jerusalem was captured by the Babylonian empire, and all the leaders of the people - the ruling class, the priests, the landowners, everybody who was anybody - was deported to Babylon. The Jews had lost everything: they'd lost their homes and their homeland, and everything they possessed, and they had to walk around 500 miles to live as exiles in a place with a different language and culture and religion.
Their temple, the centre of their communal life, was destroyed, but they brought with them scrolls containing various writings that had been kept there. During the exile, which lasted some decades, scribes and priests edited and rewrote these writings into the books that make up the majority of the Old Testament. They took a lot of much earlier material and rewrote it, and put in a lot of new stuff.
They wanted to make sense of what had happened to them, so they wrote a history of their people from the dawn of time up to the present day. It wasn't a history in the way we understand it, based on sources and documents, but a history that would tell the Jews their story as a people, and explain why this catastrophe had happened.
Their basic story is that God - JHWH - had made a covenant, a solemn promise, with Israel, along these lines: I will be your God and you will be my people. Those words occur five times in the Old Testament, and variations on the theme even more. God adopted the Israelites as his chosen people, and promised to be faithful to them. But he also told them that in return they had to stop worshipping other gods.
The scribes and priests in the exile saw this as the key to what had happened to them. God had been faithful, but the Israelites hadn't. They kept on building altars to other gods and sacrificing to them. They just wouldn't keep their promises. This made God angry and was the source of all the terrible things that had happened to the Jewish people in their history.
As soon as they got back on track with JHWH their fortunes improved, but then they'd go off and start worshiping Baal or one of the other ancient near eastern deities again, and things would start to go wrong. The scribes and priests in the exile rewrote the whole of Jewish history in line with this explanation, leading up to the terrible catastrophes of the 7th century.
As Thegreenheart says, that chapter in Deuternonomy (the key book that the scribes and priests of the exile wrote pretty much all of) is a prediction of what had already happened. They put into Moses's mouth a prediction of the fall of Jerusalem, the razing of the Temple and the exile to Babylon. And they saw the Jewish people's unfaithfulness to JHWH as the root cause. It's all about keeping your promises.
So it's completely wrong to use that chapter as a way of explaining why there are earthquakes. There are earthquakes because that is the nature of the planet that we're on. It's an anthropocentric point of view to say that God should stop earthquakes to stop humans getting killed.
Right, I'll stop there before I write a book!