Answer by taking a quote from the following article:

Dench was born in Heworth, North Riding of Yorkshire. Her mother, Eleanora Olive (nee Jones), was born in Dublin, Ireland. Her father, Reginald Arthur Dench, a doctor, was born in Dorset, England, and later moved to Dublin, where he was brought up. He met Dench's mother while he was studying medicine at Trinity College, Dublin.

Dench was appointed Officer of the Order of the British Empire (OBE) in the 1970 Birthday Honours and Dame Commander of the Order of the British Empire (DBE) in the 1988 New Year Honours. She was appointed Member of the Order of the Companions of Honour (CH) in the 2005 Birthday Honours. In June 2011, she became a fellow of the British Film Institute (BFI).  In a biography by John Miller it was noted that in the late 1990s Dench was the patron of over 180 charities, many of which were related either to the theatre or to medical causes, for example York Against Cancer. Dench is a patron of the Leaveners, Friends School Saffron Walden, The Archway Theatre, Horley, Surrey and OnePlusOne Marriage and Partnership Research, London. She became president of Mountview Academy of Theatre Arts in London in 2006, taking over from Sir John Mills, and is president of Questors Theatre, Ealing. In May 2006, she became an Honorary Fellow of the Royal Society of Arts (FRSA). She was also patron of Ovingdean Hall School, a special day and boarding school for the deaf and hard of hearing in Brighton, which closed in 2010, and Vice President of The Little Foundation. Dame Judi is also a long-standing and active Vice President of the national disabled people's charity Revitalise.  Dench is an Honorary Fellow of Lucy Cavendish College, Cambridge. In 1996, she was awarded a DUniv degree from Surrey University and in 2000-2001, she received an honorary DLitt degree from Durham University. On 24 June 2008, she was honoured by the University of St Andrews, receiving an honorary DLitt degree at the university's graduation ceremony. On 26 June 2013, she was honoured by the University of Stirling, receiving an honorary doctorate at the university's graduation ceremony in recognition of her outstanding contribution to the Arts, particularly to film.  In March 2013, Dench was listed as one of the fifty best-dressed over 50s by The Guardian. One of the highest-profile actresses in British popular culture, Dench appeared on Debrett's 2017 list of the most influential people in the UK.

Why was she honoured at those universities?
in recognition of her outstanding contribution to the Arts, particularly to film.