..."prostitute". Both words are suffixed by "-stitute", but obviously the meaning are quite different. "Substitute" is a conceptual, mental and intelligent activity, whilst "prostitute" is a profitable, body (mostly) and sensual activity. In my opinion, they don't have any reasonable relationships! So why do they spell so similar?
They are related by situation. Both are derived from the Latin root word, to stand.
One stands before (exhibited), one stands under or next to (in place of).
prostitute: from Latin prostitutus, (expose publicly, as in for sale) from pro-: before + statuere: cause to stand, establish, to put, place.
Used from the 1520s, to offer to indiscriminate sexual intercourse (usually in exchange for money).
substitution: from Latin; put in place of another, place under or next to, present, submit, from sub "under" + statuere: set up, to stand with derivatives meaning place or thing that is standing
Used since late 14c., appointment of a subordinate or successor