The debate was triggered after Trump called for a "complete shutdown of Muslims" entering the US. A petition to bar Trump reached more than 100,000 signatures, making it eligible to be considered for debate by a committee of MPs. They decided that debate will go ahead on January 18 in Westminster Hall, a kind of overflow chamber for the House of Commons.
It doesn't matter what consensus British lawmakers reach on Trump, the only people who have the power to stop people coming into the
The law basically gives May the power to refuse someone entry to the UK if she thinks their presence won't be "conducive to the public good." It really is that simple, just take a look at the Home Office's guidelines for refusing entry below.
If May herself doesn't ban Trump, it's also theoretically possible for an "entry clearance officer" from the Home Office to decide that Trump has an "adverse character" and refuse to issue a visa. Here's the relevant bit from Home Office guidlines:
So why are British MPs going to the effort of holding a debate? Conservative MP Steve Double who was on the committee that allowed the debate to go ahead, told Buzzfeed that it would be a good opportunity to ask the question " how do we, as an open democracy, deal with people who say things we perhaps don't agree with?"
That might be true, but it will also be a good opportunity for MPs to grandstand on an issue that is guaranteed to have a lot of media attention.