Stretching after your ride helps maintain your flexibility and potentially reduce the chances of injury. The main muscles that are key in cycling are the quads, hamstrings and glutes, so they will naturally get tighter over the course of a long ride. Stretching them out eases the tension in those muscles and can help stop any soreness you might have the following day.
Many cyclists will have problems with tight hamstrings - this is because the leg never fully extends at any point during the pedal stroke. Short hamstrings can also lead to lower back pain, so it's important to keep both these areas flexible to try and lessen the chances of those niggles stopping you from riding comfortably.