The hadith you are inquiring about is indeed in Kanz al-'Ummāl but with slightly different wording than the one you quoted:
كل نفس تحشر على هواها فمن هوي الكفرة فهو مع الكفرة ولا ينفعه عمله شيئا
— NOTE: My own translation, so treat with care:
Every soul will be resurrected according to its desire. Whoever loves the disbelievers will be with the disbelievers, and his deeds will not benefit him.
— Kanz al-'Ummāl, Book 9, Hadith 24852
This hadith is also in Al-Mu'jam al-Awsat 9/13/8978, and in Majma' az-Zawā'id wa Manba' al-Fawā'id as 1/113/442, 10/275/17992, and 10/332/18317.
The hadith has 'Abdullah ibn Lahī'a in its chain, which makes the hadith da'īf (Weak). There are other hadiths, though, that convey a similar meaning as in the hadith narrated on the authority of Anas ibn Malik:
عَنْ أَنَسِ بْنِ مَالِكٍ، قَالَ جَاءَ رَجُلٌ إِلَى رَسُولِ اللَّهِ صلى الله عليه وسلم فَقَالَ يَا رَسُولَ اللَّهِ مَتَى السَّاعَةُ قَالَ: وَمَا أَعْدَدْتَ لِلسَّاعَةِ. قَالَ حُبَّ اللَّهِ وَرَسُولِهِ قَالَ: فَإِنَّكَ مَعَ مَنْ أَحْبَبْتَ. قَالَ أَنَسٌ فَمَا فَرِحْنَا بَعْدَ الإِسْلاَمِ فَرَحًا أَشَدَّ مِنْ قَوْلِ النَّبِيِّ صلى الله عليه وسلم فَإِنَّكَ مَعَ مَنْ أَحْبَبْتَ فَأَنَا أُحِبُّ اللَّهَ وَرَسُولَهُ وَأَبَا بَكْرٍ وَعُمَرَ فَأَرْجُو أَنْ أَكُونَ مَعَهُمْ وَإِنْ لَمْ أَعْمَلْ بِأَعْمَالِهِمْ
Anas ibn Malik reported that a person came to Allah's Messenger (ﷺ) and said to Allah's Messenger: "When would be the Last Hour?" Thereupon he (the Holy Prophet) said: "What preparation have you made for the Last Hour?" He said: "The love of Allah and of His Messenger (is my only preparation)." Thereupon he (the Holy Prophet) said: "You would be along with one whom you love." Anas said: "Nothing pleased us more after accepting Islam than the words of Allah's Apostle: 'You would be along with one whom you love.'" And Anas said: "I love Allah and His Messenger and Abu Bakr and Umar, and I hope that I would be along with them although I have not acted like them."
— Sahih Muslim, Book 45, Hadith 208
There is also another hadith narrated on the authority of 'Abdullah ibn Mas'ūd in Sahih al-Bukhari 78/195 that people will be with those whom they love.