The answer is "actors want work". They're also somewhat realistic about recognizing how they're marketed... if an actor is overweight... they're going to get cast in a lot of roles for "overweight people" and very few roles for "normal people".
Similarly, if someone has a "character face", they know that they have a non-traditionally beautiful look and they embrace it rather than trying to only take on roles for "beautiful people".
When a casting director needs to cast people with unusual looks the casting call goes out with a character description to all of the agencies in the area and the agencies submit their talent for the roles... so, if anything, it's on the agent's head for submitting their talent for an "ugly character" role. If offered an audition, the talent can always opt to back out (though it's not good policy to refuse auditions).
If it's an open casting, the talent will submit themselves, so they've already decided they're OK with the fact the character is "unusual", so they're not going to be offended if they get the role for being the fattest or most unique-looking. They're going to be happy they've been cast in a project and they're getting a great payday for it.
These roles are not common because, Hollywood particularly, likes "pretty", "healthy" people. Certain directors look for more unique looks (Terrence Malick, for example casts a lot of character faces in the minor roles in his films... he loves gritty, hard-worn looks) but, in general, they look for people that someone will want to watch for two hours (or several years, for a TV show). So these actors with that non-"standard" look will jump at the opportunity to finally have a role they can fit into... particularly if it's a good role and not just a role that makes fun of the fact that they're fat or ugly.
The reality is, if an actor can't be comfortable with their look, they either change it through diet/exercise or surgery... or they don't work in the industry for very long because they will never be satisfied with the roles they're offered.
Don't forget, makeup (or lack thereof) does a lot to make someone look "ugly" in our era that delights in perfect skin... so, in some cases, being "ugly" isn't inherent to the talent, it's all about how their makeup is done.