The past simple and the past continuous do not mean exactly the same. Compare:
When Mary arrived, we were having
dinner.
This means
that we had already started dinner before Mary arrived.
When Mary arrived, we had
dinner.
This means that Mary arrived and then we had
dinner.
Compare:
-What were you doing
when you heard the crash?
-I was reading the paper.
-What did you do
when you heard the crash?
-I ran to the window.
More examples:
I was dreaming when you woke
me.
The police stopped him when he was driving
home.