Salting cucumbers is done to remove excess moisture from the vegetable, as cucumbers have a high water content. This helps improve their texture, making them crisper and firmer.