Ignoring for a second that this comparison completely ignores the vastly different risk profile of these two investments, it also ignores the fact that on an absolute basis, a 2% dividend yield is among the lowest in history and portends very low returns going forward.
The right to family life is not absolute (unlike the right not to be tortured) but may yield in the public interest, including safety and economic well-being.