You can get an intuitive explanation by considering the extreme cases. Bring the rod into the corner parallel to the first corridor, and it can be infinitely long. Start to turn it around the corner, and it must be shorter and shorter to fit between the two outer walls (the lower one and the right-most one). When you have passed the 45 degree point, symmetry shows that this same logic repeats: the rod can now be longer and longer until it can be infinitely long when parallel with the second corridor. The shortest moment was obviously at the 45 degree point.
If the corridors weren't equal in width, it'd quickly get too complicated to intuitively figure it out this way.
Mathematically, I think I would parameterize a straight line (something like $s=\left(a\cos(v),a\sin(v)\right)$, with some proper x- and y-interval restrictions) and equate it with the parameterized corridor area and with the corner point. Solving those two equations simultaneously should give you the length $a$ which you can then minimize. But I would advice you to ask this on Mathematics SE if you seek more in-depth mathematical answers.