「~はいけない」is just a prohibition.
『知らない人について行ってはいけない。(You must not follow strangers.)』
But 「~ものではない」is not just a prohibition. It has many connotations.
1. 『彼女はあまり美人じゃないね。(She isn't so beautiful.)』『そんなことを言うものではないよ。(I think that is impolite to say.)』
2. 『僕はもう長くないんだ。(I have a very short time to live.)』『そんなことを言うものではないよ。(Don't say things like that and cheer up!)』
3. 『がん診断が下ったらどうしよう。(What'll I do if I diagnosed with cancer.)』『そんなことを言うものではないよ (Don't say something like that, it will bring you bad luck.)』
Meanings of 『そんなことを言うものではない』 excerpted from Eijiro: 相手の発言をやめさせる。「それは失礼だ」「そんなことを言われると悲しい」「そんなこと言わずに元気を出して」「縁起でもない。やめて」など、いろいろなニュアンスで使う。