Giles noted that England have not given up entirely on Hales yet. © Getty

Ashley Giles has admitted that Alex Hales could still have been in England's squad had news reports not emerged of the batsman failing a second recreational drugs test.

Last Friday, The Guardian published a story that said Hales was serving a 21-day ban for a second drugs test failure. Days earlier, his county, Nottinghamshire, had released a statement saying Hales had been given time away from the game for "personal reasons". However, three days after The Guardian story, the 30 year-old was removed from England's squad for the summer, including the World Cup.

Giles, England's director of men's cricket, said that "a string of poor behaviour over time" and "the effect the [latest] news had on the players, the management and the captain" were the reasons for Hales' omission but admitted that he and Tom Harrison, ECB chief executive, knew of the failed drugs test before the provisional World Cup squad was selected.

However, because of what Giles called "a duty of confidentiality", that information was not shared with England's selectors and Hales was picked for the one-off match against Ireland, the series against Pakistan as well as in the provisional World Cup party.

"When the teams were selected, the selectors and the captain were unaware of any issue surrounding Alex," Giles said. "The advice we got from our legal guys was categorically we had a duty of confidentiality which we stuck to. We couldn't tell them, simple as that.

"But once the story broke on Friday, the effect of it on the England environment - on the players, management and captain - was really strong. We're building towards our biggest summer of cricket in 40-50 years and our responsibility is to making sure we're in the best possible shape going into the World Cup. This became too big a distraction for our environment to have."

Once the ECB announced the news on Monday, Hales' management team, 366 Group, released a statement saying the batsman had been given assurances that the incident would not affect his World Cup chances. That was not disputed by Giles when speaking to the media in Dublin on Thursday and he also admitted that if the news had not broken, Hales may have been able to remain with the England party.

"I didn't think that statement was particularly good, but he's clearly disappointed and we get that," Giles said. "We - Tom Harrison and I - kept our part of the bargain and maintained our integrity throughout this. Someone else clearly didn't. That's the problem.

"We said no off-the-field incident could have a bearing on World Cup selection. We stand by that. Any process, whether it be discipline or otherwise, you can't have double jeopardy.

"At the same time, Tom and I can't make guarantees on selection because we're not selectors. That's not handing over responsibility, but we assured him in this case that, for this off-the-field incident, it could not have a bearing on World Cup selection.

"But once the story broke, the effect was really strong. It was too big a distraction for our environment to have. So yes, of course, had the story not been made public, the environment would not have been affected and he could have stayed in the side."

Captain Eoin Morgan met with five other senior players - Joe Root, Chris Woakes, Ben Stokes, Jos Buttler and Moeen Ali - at England's training camp in Cardiff over the weekend to discuss the issue and recommended to Giles that Hales, who attended the get together, was excluded from the squad. From the players, coaches and selectors, there has been near unanimous backing for the decision.

"Being at England's camp in Wales and seeing the effect of that news, it was clear it wasn't going to work," Giles said. "There's an element of trust in that environment and if that trust is not within the group, that's a problem. I think that's what occurred here. It could be seen that a string of poor behaviour over time has led us to this point.

"There was consultation. The captain consulted with his senior players and I talked to the captain and the coach. I'm not a selector, but the selectors were unanimous in this decision, fully supported by myself and Tom Harrison that this was the right way to go."

Where Hales goes from here remains to be seen. He will play for Nottinghamshire in the Royal London One-Day Cup on Friday and the county will be sticking by him. Their Director of Cricket, Mick Newell, told The Nottingham Post: "He's behaved like an idiot but he's our idiot... We want to support him. He's not someone we're going to throw away. That's not how we work."

Although Hales will be 34 by the time of the next World Cup, England's management are not ruling out his return to national duty either. "Alex has been an important part of this team's journey over a period," Giles said. "The door isn't closed, whatever people think.

"What we want to see is some really good behaviour over time and some good cricket, of course. We're there to support him. I understand he's going back to play for Notts but it's important we have support from all corners, whether it be the PCA, the ECB or Notts. The player's welfare is still fundamental. But there's some making up to do, I'm sure."