Spirit Airlines, an icon of budget air travel that reshaped the industry, has filed for bankruptcy protection after years of mounting losses, a failed merger and more demanding consumer tastes.