Before the text of my original answer I like to point to an edit that I have made. I have added some general remarks on the role of peoples' emotions in this at the end that I think are very important here, particularly seeing how the discussion has played out in the meantime. Now here's my original answer:
I'm in between the answers that already have been posted. I do think your joke was potentially problematic, and it counts in your favour that you see this and worry about it to some extent.
However I also think that there are important potential disadvantages of any follow-up action from your side. The two major ones have already been given by @Ben: (1) You bring back the attention of the students to this situation, which in itself may be problematic, and (2) you may make students feel bad who initially laughed about the joke (although on the other hand some of these may regret they have done that or may have felt bad at the moment and only joined in because their classmates did).
On the other hand, @Ben wrote: "Honestly, if I were one of the students who laughed at your joke, I would probably think you're a cool and fun lecturer". @Ben meant this as a reason to not apologise, but actually you may distinctively not want to be identified with such a joke by students who found it cool.
I have learnt a lot from Ruth Cohn's Theme-Centered Interaction. Two of its major principles ("Postulates") are that "disturbances and passionate involvements take precedence", and "Be your own chair person". Applied to your situation I'd see this as an appeal to evaluate your own emotional state regarding the situation. To what extent do you think this could harm a good working relationship between you and your students, particularly considering how you feel about it? To what extent you really feel you should do something about this, as it is on your conscience? I think that this is a very individual decision, also it may have to do with your general impression of the mood in the class and the interaction in it and with it. (The acknowledgement of the importance of the relations within the group is another major aspect of TCI). In some groups, particularly in psychology, I can even imagine that a discussion about how bad people think such a joke is and whether an apology is a good thing to do can be constructive and interesting. You should certainly not impose your view about this on the students, and as you see in this thread, there may be perceptions very different from yours, but this doesn't mean you should not talk about it at all. So I can't ultimately say what you should do; I can see justifications for both not doing anything, or talking about it including that you say you regret it (but this will also depend on how exactly you say things and whether and to what extent students are then involved in any kind of discussion).
An issue that comes up in the discussion here is that some people identify your suggestion to apologise with a general tendency to be overly (self-)critical and sensitive regarding the things that are said, maybe fuelled by media, certain institutions, or political interest groups. Now this general tendency may exist and there may be reasons to be critical about it, however this should not distract us from trying to be aware of the things we say and the consequences and implications that that might have, and from having a conscience and occasionally act on it, even if it may be perceived as tedious by some others. I don't think it is a good idea to apologise in order to do "damage control" or because you were somehow made to believe that we should apologise more if we make bad jokes. But if you feel a genuine personal need to do it, even having in mind the potential disadvantages and issues with it, that is a much better reason.
Edit: Some general added remarks. I think it is important to acknowledge that emotions of people exist and are important, and that they don't always behave in a rational manner. I also think we need to acknowledge the fundamental subjectivity of such emotions. The implication here is this:
Whether a joke is offensive, insensitive, or "in poor taste", or not, is not an objective fact, but rather an issue of individual perception. The discussion clearly shows that many perceive the joke in question as not problematic, and the questioner is apparently also in the lucky situation to not have observed any evidence that some students would have found it offensive or insensitive. However I find it important to acknowledge that (1) neither the questioner nor we can know whether there was actually the odd student who had problems with this, and (2) that the questioner themselves felt worried about it afterwards. And also (3) that many people feel annoyed by the idea that is apparently held by some that there is a necessity to always be super careful when talking in order to avoid that anyone could be potentially offended or disturbed, and that we should feel bad afterwards if something potentially problematic has slipped off our tongue, as happens so easily.
What is important here is that to the extent that these emotions happen, their existence and importance for the person in question has to be acknowledged. This is not an issue of right or wrong; these are inappropriate categories for emotions. Nobody is a better or worse person for feeling this or that (it is actually possible to question one's own feelings and to decide to not act on them; acknowledging our feelings doesn't mean they have to dominate us).
The general topic of this question is a tough one because there is apparently a temptation to think that either a joke is or isn't really problematic, and, somewhat independently, is or isn't really funny. This would imply that if the joke in fact weren't problematic, students who felt offended or otherwise bad about it would be wrong. Or, on the other hand, if the joke really were insensitive and of poor taste, the lecturer (and also the students who actually found the joke funny) would rightly need to feel bad about themselves and go through all kinds of self-castigation.
I argue that this is an inappropriate way to assess the situation. I think in the first place the existing feelings need to be acknowledged and respected, without implying that they are in the right. A student who feels offended has the right to feel offended. This does not mean that there was any "objective" wrongdoing on the side of the lecturer whose joke may have led to the student taking offense.
Also, the lecturer may be concerned (and this is neither right nor wrong, just their state of emotion) even if in fact the joke didn't harm anyone (and of course a student may have felt hurt even if in fact no such student was in the room). The lecturer still has to deal with their own emotions, which may or may not include addressing the issue with students again (there are advantages and disadvantages and it depends on the specific situation and also the involved persons how they can proceed). Of course in that case telling them "we think this is no big deal" may help, particularly if indeed no student was offended or disturbed, which we can't know.
In situations in which indeed somebody feels offended but there was no bad intention, and many others even liked the joke (which in itself is positive, and also a sentiment that isn't right or wrong in the first place), there is genuine conflict. It needs to be acknowledged that the emotions of different people in such a situation can be in conflict without one of them being clearly right and the other one being clearly wrong. Any idea how to deal with the situation can start from there, but there will be no simple solution because the conflict is implicit in the emotional setup.
These situations are very difficult and therefore also of interest. The question has a good number of upvotes for a reason, and I really don't think it should be closed as a "non-question" (as some apparently do). I will though also acknowledge the emotions of those who don't like to be asked to reflect on every single word that they're saying all the time, and who are worried about freedom of speech and that communication may become super tedious and ultimately unbearable if we need to worry all the time about not offending and not being insensitive even in the most innocent of situations. I may on occasion also identify with this group, if not today.