Yes, pilgrimidge has stopped in the past for various reasons includind the risk of spreading disease further during a pandemic. You can search various sources on the internet for dates.
As for the jurisprudential point of view, there is a general rule in Islam of "no harm" where if something is to cause harm it is not permissible. For example, if some one is sick and they are sure or even in fear that fasting will harm them - then they should not fast.
In Hajj, also the same scenario applies.
وَلِلَّـهِ عَلَى ٱلنَّاسِ حِجُّ ٱلْبَيْتِ مَنِ ٱسْتَطَاعَ إِلَيْهِ سَبِيلًا
And it is the duty of mankind toward Allah to make pilgrimage to the House—for those who can afford the journey to it
This "who can afford" is not simply affording it financially, but also in terms of safety. So if there is a situation where there is fear of health reasons then hajj is cancelled.
Of course - this statement is not a justification for the closure of hajj in the current COVID19 scenario however the point of this answer is to show the potential reasoning behind halting hajj.
S.L. Al- Hakim