Was Holden asking for Carl Luce’s company because he was lonely, or was there an ulterior motive?
While Holden almost certainly calls up Carl Luce out of loneliness, there's a bit more to their interaction in Chapter 19 as well. Two chapters before, Holden has a terrible date with Sally—he has a particularly hard time communicating with her, something that carries over into his conversation with Carl.
Holden introduces his character through his connection with sex, talking about his knowledge of 'flits,' or gay men, as well as proposing that Carl himself might be gay. Carl, who was a student advisor at Whooton, routinely gave the students talks on perverts and sex, making him a pretty knowledgeable figure in Holden's mind. Holden also makes a point of discussing his intelligence, saying, "He was a pretty intelligent guy, though," and "You're one of those intellectual guys."
Their conversation immediately gets personal as Holden asks inappropriate questions about Carl's sex life, which Carl rebukes him for. But when Holden tries to ask for advice after kidding around, Carl says, "Listen, Caulfield. If you want to sit here and have a quiet, peaceful drink and a quiet, peaceful conver—" Holden cuts him off, assuming it's because he doesn't want to discuss anything serious and not because of his earlier inappropriate questions, and goes right back into discussing his sex life.
It's hard to say what exactly Holden is looking for from this conversation other than companionship, especially because Carl cuts him off and Holden isn't particularly forthcoming about what he was going to ask. As the conversation continues, Holden becomes interested in Carl's characterization of sex as a "physical and spiritual experience," because of his relationship with a Chinese woman.
Holden seems intensely focused on the connections between people, whether it's shown through his belief that Carl is gay because of his conversations and interest in students, his own loneliness, or his obsession with having a personal connection through sex. He seems aware that there's something wrong with his connections with others—at the end of the conversation, Holden asks what Carl's father, a psychiatrist, would do to him if he were to be psychoanalyzed—and seeks out Carl to shed some light on his own problems.
While the primary motivation might be eliminating some of Holden's loneliness, that's not the only reason. He believes Carl to be an expert on sex and very intelligent, and he hopes that he'll shed some light on his own problems. Many readers believe that Holden himself might be gay, which adds an additional level to the conversation—it's possible Holden's fascination with 'flits,' and Carl in particular, is a reason for him to reach out for some sort of validation. Unfortunately, Carl believes Holden is still too immature to hear anything he might have to say, and Holden ends the conversation much the way as it started—alone and unsure.