As an extension of the grammar pattern
訳(わけ)にはいかない ‘can’t afford to do (A)’, or ‘impossible to do (A)’,
ない訳(わけ)にはいかない creates a double negative which is frequently translated simply as ‘can’t not (A)’, or ‘no way to avoid (A)’.
As this is a combination of the negated form of a verb, 訳(わけ) ‘reason’, or ‘logic’, に, は, and the negated form of 行(い)く, the literal meaning is just ‘there’s no reason that (A) can’t be done’, or ‘it cannot be so that (A) won’t be done’.
-
いつもお世話(せわ)になっている先輩(せんぱい)の結婚式(けっこんしき)だから、行(い)きたくなくても行(い)かない訳(わけ)にはいかない。
It's the wedding of a senior who has always been a great help to me, so even if I didn't want to go, I can't not go.
ダイエット中(ちゅう)だからといって、何(なに)も食(た)べない訳(わけ)にはいかない。
Just because I am on a diet doesn’t mean that I can’t not eat food.
めんどくさいからと言(い)って、宿題(しゅくだい)をしない訳(わけ)にはいかない。
Just because it's a hassle doesn’t mean that you can’t not do your homework.
Compared to other similar structures like なければならない, ないといけない, and various others,
ない訳(わけ)にはいかない implies that there are some circumstances as to why (A) cannot be avoided, so will often be used when giving an excuse or reasoning as to why one must do (A).