Gear pins lock the locking mechanism in place, providing an additional layer of safety in preventing accidental gear retraction on the ground. Other parts of an aircraft have ground locks fitted for similar reasons.
The long red streamers indicate that they are in place and must be removed before flight. Otherwise they prevent intentional retraction of the gear after getting airborne.