The idea that Jedi aren't supposed to be having sex seems pretty hard-coded into most people's understanding of Star Wars. After all, wasn't this why Anakin and Padme snuck around, kept their marriage a secret, and fretted about Padme's pregnancy possibly destroying their careers?
The answer to that, in appropriately cryptic Jedi fashion, is "yes and no." As Anakin awkwardly and woodenly mentions in Attack of the Clones, Jedi are forbidden from a number of things adjacent to sex and romance, such as "attachment" and "possession." Plus, as Yoda likes to point out (and Anakin likes to be the example of), attachment is dangerous because when a Jedi's loved one is threatened or killed, it can easily lead them to the Dark Side. So, the attachment and possession of marriage is definitely forbidden.
So, what about just plain sex? As many people figure out from a young age, the actual act of sex doesn't require attachment or possession. A Jedi sleeping with another living being doesn't mean that they must get married and settle down. Anakin even seems to hint to this, when he gives Padme his best bedroom eyes and points out that Jedi must have "compassion," which he defines as "unconditional love," and thus the Jedi are "encouraged to love" other people.
While this may all sound like speculation, it was actually confirmed by George Lucas himself. During a 2002 interview in London, Lucas clarified the typical understanding that Jedi are sexless warrior monks by pointing out, "Jedi Knights aren't celibate — the thing that is forbidden is attachments — and possessive relationships." Suddenly, Obi-Wan's familiarity with Tatooine's bar full of sexy strangers makes a lot more sense.