"out of something" is used to show the reason why sth is done. For example :
"I asked out of curiosity."
"She did it out of spite."
Therefore "doing something to somebody out of respect" means to do something because of the respect one has for the person in question.