To do something indecently is to do it in an inappropriate, lewd, or offensive way. If your grandmother complains that your party guests are indecently dressed, she probably thinks their clothes are too skimpy.
Many people in the audience will be offended if a political figure jokes indecently, and being treated indecently by a police officer is a good reason to file an official complaint. Indecently comes from the adjective indecent, "inappropriate or in bad taste." The Latin indecentem is the source, from in-, "not," and decens, "becoming, fitting, or proper."