The short and scandal-filled presidency of Harvard’s Claudine Gay, who resigned Tuesday, serves as a harsh lesson in public relations and politics.