These are different senses of the word of.
When we say "two of us are coming tonight", of indicates " that someone or something belongs to a group of people or things" (the 2nd definition at Webster's Learner's Dictionary)
When we discuss "two millenia of diaspora", we are using the 8th definition, "used to indicate what an amount, number, etc., refers to". We are saying that the duration of the diaspora was two millenia.
Another way to look at this is, one meaning of diaspora was the time when Jews were prevented from living in Israel and spread around the world. But another meaning is the community of Jews around the world who continue to live outside Israel. In this sense the diaspora continues, so the two millenia of diaspora in the past is only a part of the "whole" diaspora that we can expect to continue into the future. So in this sense, the diaspora does indeed extend for more than two millenia.
Or, we could consider another sense of diaspora, which is not always used specifically in reference to Jewish history. There is also an Armenian diaspora, an African diaspora, etc. In this sense, the Jewish diaspora is only part of all the diasporas that have ever been, and so when we talk about "two millenia of diaspora" we could be talking about considering the Jewish diaspora as just one of many diasporas in history.