Legged robots can operate in complex terrains that are unreachable for most wheeled robots. While insect legs contact the ground with the tarsal segments and pretarsus, most insect-inspired robots come with a simple tarsus such as a hemispherical foot tip. Insects, like the M. Torquata beetle, use the claws as their attachment devices on rough surfaces. Their sharp claws can smoothly attach and detach on plant surfaces by actuating one muscle. Thus, legged robots can mimic tarsal structures to improve their locomotion on inclined and rough surfaces. We conducted two types of experiments to test the hypothesis that the tarsal flexibility and rigidity play a role in the beetle's smooth walking. By cutting the membrane between the tarsomeres, we disabled the tarsus' rigid ability, so the claws cannot securely hook onto the walking surface. Conversely, after eliminating the tarsal flexibility, the beetle struggled to draw the claws out of the substrate. The results confirm the significance of the tarsus' properties on beetle walking. Then, we designed a cable-driven 3D printed tarsus structure to validate the function of the tarsus via a robotic leg. The tarsal configuration allows the prototype to hook onto and detach smoothly from the walking surface.