He chose the lessor of two evils. Might screw the grand plan, next to, millions more people will die daily if the rest of them don't escape with the plans, find a weakness and destroy the DS. Also, you can kiss that plan goodbye if they all die, then and there.
Amidst dueling with Vader, Ben turns to see the rest of his party (which, knowingly includes his honorary niece and nephew) a mere five feet from their ship, all but waiting on him. Between them all, are five storm troopers and roughly 150 feet of ground or so to cover.
He'd have to dispatch Vader (and as we know, he is incapable of that task anyway), help kill the five guys, plus whomever else had showed up in the interim, risk the docking bay doors being closed, run half a football field and any number of other considerations too lengthy to contemplate: Standing at the ramp of the ship, their best option of escaping is the one where Ben is no longer a factor.
(Obi-Wan is struck down. All hell breaks lose)
Everyone yelling at Luke: Common!
Leia: Luke, it's too late!
Luke would have stood his ground until it was too late for all of them. As far as he knew, Obi-Wan was his last surviving family member. Force ghost or no, this is the only available tactical solution with an acceptable success margin.
That he sacrifices himself so willingly either means he's a better man then I, or he knew what he was doing. I think both.