It is because the heaven is a place that shall be reserved only for the pure souls. If every human being is allowed to enter the heaven then then the heaven will not be much different than the earth. The entire point in the heaven being a place of eternal joy and comfort is that the humans in that exclusive place will have already trained themselves and proven to remain cognizant of God thereby not committing any evil and injustice like they do on the earth.
God never told us that He loves every human being unconditionally. In fact, He is quite explicit in the Quran about the kind of people whom He loves and the kind that He does not. For example, He does not love the unjust people. It also is precisely the love of God that He has created such a perfect place like the heaven and informed us beforehand how to become eligible for a spot in it.