If you're joining the Rebellion, you are a passionate, driven individual. You have your reasons to hate the Empire, and you support the Rebellion with everything you have and everything you are.
Think about what joining the Rebellion means: you are not just a criminal, you are a traitor in the eyes of the Empire. You cannot ever expect anything but death if you're caught, you are knowingly committing yourself to a life of hiding and running, fighting every minute of every day.
If you're a fighter pilot? You are worse. You didn't just join the Rebellion, you put yourself outside of the relative safety of the larger ships. Most starfighters can't survive more than a hit or two from any thing that is larger than man-portable (and some weapons that ARE).
Fighter jocks are brave to the point of ludicrousness, and see themselves as the first line of defense against the enemy (largely because this is the role they play). The whole reason to use fighters is because they are cheap and easy to replace. Fighter jocks know this, they do their job knowing they're expendable. If a dozen pilots and ships lives can be spent to save a larger ship, it will be done in a heartbeat. The pilots know and accept this.
That sort of personality, facing certain death? They're going to try to take their enemies with them. A damaged snowspeeder? You can't maneuver well enough to use the standard attack patterns, and you'd be blasted out of the sky if you broke off. You're already dead, might as well take out a walker and buy your allies a little more time.
An A-wing? Fragile as hell. Green leader's ship was already lost, and ejecting into space right above the Executor? His momentum would have carried him into the ship or its shields anyway. Worse, if it hadn't he'd have been the Empire's 'guest' (as his only way of surviving would have been via a quick application of a rescue tractor beam, and only the Imperials were close enough).
Even the back pair of fighters in the Trench Run on the first Death Star were just there to be an extra pair of shields between the Imperials and the torpedo-armed fighters. Most fighter pilots in the Rebellion went into combat expecting to never come back.
They're fighting a guerrilla war against a larger, more powerful force. To do any damage, they have to commit themselves fully to that cause. A suicide charge that might slow or stop an enemy and save your friends or further your cause? Lots and lots of times through history, we see that it can and does happen.