Technically immoral is a judgment.Ok. Vices are considered immoral. But in the right context they are to be enacted just as Krishna did. They are greater than even virtuous acts.
In a similar way maya seems to be an obstacle to our straightforward vision. But the real purpose of the obstacle is to make you rise. So in the higher scheme of things it is actually a facilitator.
What we ought to understand is using our perception to know what works for us and what does not work for us.
What we call " immoral" are actions that which is not conducive for our system.
I dont really spend time to think what is the cause and the real reason of an obstacle, I just carry on with my journey.
For eg if suddenly there is a traffic jam and I need to get to work on time...I just find an alternative route.
Why waste time to ponder "what is the real purpose of the traffic jam today"
See what I mean, in real life we consciously go beyond obstacles ..makes me wonder why you seem to be attached to Maya.