A former Conservative MP has walked free from court after admitting altering their passport to access a gambling website..