(Click the character infographic to download.)
Ackley is dirty, pimply, and all-around unhygienic. He's annoying. He'll come into your room and pick up your personal stuff and put it back in the wrong place. He'll cut his toenails all over your floor. And he thinks being two years older than Holden makes him superior.
Holden really doesn't like this guy.
So—why does he seem to spend so much time with Ackley? On the one hand, you could argue that's because, despite his cynicism and judgment, Holden is actually a compassionate guy. He invites Ackley to come along with him and Mal Brossard to the movies because no one else would hang out with Ackley for the night. Or, you could say that Holden is so lonely he hangs out with Ackley, even though he can't stand the guy. After Stradlater punches Holden in the nose, he goes into Ackley's room looking for company and conversation for the night.
Most likely, it's a combination of both.