One difference is empathy vs guilt
It's a pity.
invokes feelings of empathy.
He felt pity for the Syrian children caught up in the war.
he felt compassion for the children suffering in Syria.
It's a shame.
invokes feelings of guilt.
She felt shame that she could not help the children in Syria.
she felt guilty that she could live comfortably but the children in Syria were suffering and there was nothing she could do.
In your example, two possible different meanings might be
It's a shame that the price of this book will put it beyond the reach of many readers.
it's unfortunate that the price of this book...
It's a pity that the price of this book will put it beyond the reach of many readers.
it would be better if the price of this book was not beyond the reach...