God did not create us because He was lonely. I don't mean to burst anyone's bubble, but God would have done just fine without humanity to contend with. The fact of the matter is that God is independent of humankind. In other words, God does not need us, or the rest of His creation, for anything. The apostle Paul explained it when he made this statement:
God, who made the world and everything in it, since He is Lord of Heaven and earth, does not dwell in temples made with hands. Nor is He worshiped with men's hands, as though He needed anything, since He gives to all life, breath, and all things. (Acts 17:24–25)
God doesn't need me. God doesn't need you. He is not dependent upon any of us. Instead, He tells us, "I have loved you with an everlasting love; therefore with lovingkindness I have drawn you" (Jeremiah 31:3). So listen—God did not create humanity because He had to, but rather because He chose to. He chose to make us, and He chooses to love us.
So let's give praise and thanks to our Creator for His everlasting love.