I would suppose it was to show that she was not afraid to die and for him to find if the spirit of Rohan was strong enough to help him.
Why would Aragorn fight Eowyn in the first place. He needed the Rohirrim to help save Gondor. I am pretty sure had he killed Eowyn, his standing in Rohan would have diminished greatly and the Rohirrim wouldn't have rode to his aide..