Test Code Is Production Code

If developers carefully design, model and test “production” software, "test automation" software needs the same attention.

Code drives test automation. Even when using "codeless" automation tools, code exists under the covers.
Yet, many overlook this as throw-away code or something less important than the application it exercises.
Is this a mistake?
Does test automation code deserve the same attention as "production" code?