I think Withnail tries to sell out his housemate (for promised sexual favors) for his uncle’s favor (for access to his cottage) because on some level he wants Peter Marwood for himself, but is too consumed with fear and self-loathing to make the necessary overtures. But if he can get his Uncle Monty to bag Marwood, it not only represents a seduction-by-proxy; it might even break the ice for him to be with Marwood in the future.
As for Marwood’s frequent unease and panic throughout the film, that’s a combination of the timidity of a callow young man recognizing his shortcomings (vis-a-vis bigger, more experienced and aggressive drunks, poachers, etc.) and of his homosexual panic, as he recognizes that some men are attracted to him. This aspect of Peter’s self-awareness would have been better explained had Bruce Robinson attributed Withnail’s embittered lament early in the film (about another actor landing a plum role, no doubt by granting sexual favors to the gay director) to Peter instead, thus suggesting that Peter’s sex appeal to gay directors had already become a factor in his stalled career as a thespian, making him perpetually anxious and angry over being hit on.
This is in fact what happened to a young Bruce Robinson after he was cast in Franco Zefferelli’s Romeo and Juliet (1968, the same year “Withnail” is set). Since Robinson’s written that he based his “I” (Peter Marwood) character on himself, it would have only been fitting to have had Peter have the line about the other actor trading favors for his role. The autobiographical truth is that Bruce Robinson had to repeatedly fend off the older, obese Italian director’s assertive advances on the “Romeo” set and in fact suffered a nervous breakdown upon his return to the U.K., followed by a short stay in a mental hospital – and that for a number of years thereafter he continued to suffer the advances of wealthy, older gay men who wanted a piece of his ass. The whole “Uncle Monty” character is basically an act of poetic justice in which Zefferelli is transmuted into a fatuous, grandiose, lonely loser for ridicule and pity.
As it is, though, I don’t think Peter necessarily senses Withnail’s suppressed homosexuality at all, at least until he learns that Withnail’s misrepresented him as a “toilet trader” to Monty; after this, he’s suspicious of his friend and is more willing to stand up for himself and distance himself from Withnail (as in moving for his acting job and refusing to share the final bottle at the end with him).
Withnail’s oration of Hamlet’s soliloquy in the park was note-perfect, except for his confessional repeating the “No, nor women neither” line. The Hamlet theme not only links him to his gay uncle, but strongly suggests that his fate is not destined to be a happy one. This, too, is in keeping with real-life inspiration for Withnail, Bruce’s friend and late-'60’s housemate Vivian McKerrell [sp?], who for all his natural charm, intelligence, and wit, never found meaningful work as a thespian and drank himself to an early death in the '70’s.
Another housemate they had at the time was David Dundas, whose parents owned the house they all were living in. Dundas would go on to write commercial jingles, including a one-off hit pop song for a 1976 jeans ad (“Jeans On”), as well as the instrumental music score for Withnail & I.