The dog gave away his position
He took the cap off and saw Diego’s face change from fear to relief and then to confusion. He asked his dad what he was doing here and why he had the neighbors dog with him. Pablo knew that there was no point in lying and didn’t want to set a bad example so he came clean about everything.