For the following answer, assume we have two communities of size 4. Community 1 has two organisms of species A and two organisms of species B. Community 2 has three organisms of species A and one organism of species B.
The probability that two randomly selected organisms belong to the same species
In this example, for either community, the probability that two randomly selected organisms belong to the same species is the sum of the probability of selected two organisms of species A and two organisms of species B. In other words:
P(selecting two of the same species) = sum(P(selecting two of species X))
Where we sum over all species present (in this case, species A and species B)
The probability of selecting two organisms of species X is the probability that the first organism is species X times the probability that the second organism is species X.
The probability that the first organism is species X is simply:
P(first organism is species X) = nX/N
Where nX is the total number of organisms of species X and N is the total number of organisms in the community.
The probability that the second organism is of species X is:
P(second organism is species X) = (nX-1)/(N-1)
Because we are sampling without replacement, we subtract one from each value as we are now sampling from a community that is missing one individual (the one we first sampled).
The probability that two randomly selected organisms belong to species X, is then the sum of the previous two probabilities:
P(Selecting two of species X) = nX/N * (nX-1)/(N-1)
or
P(Selecting two of species X) = nX(nX-1)/N(N-1)
Then, to get the probability that two randomly selected organisms belong to the same species, we sum the above equation for all species. Summing over all species will give us your first equation.
In this case, for both communities we sum over species A and species B.
P(Selected two of same species) = [nA(nA-1)/N(N-1)] + [nB(nB-1)/N(N-1)]
P(Selected two of same species) = [nA(nA-1) + nB(nB-1)]/N(N-1)
For community 1, this comes out to 0.333. For community 2, it comes out to 0.5, accurately representing that community 1 is more diverse.
Why can't you take the total number of organisms and divide it by the total number of species?
The point of the Simpson's biodiversity index is not just to represent the total number of species in a community, but to portray how spread-out organisms are among the species; a community in which one species dominates and the rest are rare is considered less diverse than a community with the same number of species that has a roughly even number of individuals per species.
In the case of our two communities, the total number of organisms divided by the total number of species will give us the same number (4/2), not accurately representing that the communities do not have the same diversity (they have a different spread of organisms)