It's an invalid script why is this not rejected in the first place?
It's not invalid, but nonstandard (even though it may not have been deliberate)
(The script itself is invalid, but the transaction as a whole is valid because it obeys bitcoin protocol rules.
It's possible to have an invalid script but a valid transaction eg this one, and a valid script but an invalid transaction eg one whose input has been included in the blockchain)
Invalid means that it tries to break bitcoin protocol rules in some way (eg double spending, if the script stack returns false, creating more outputs than inputs --1 BTC input creating 5BTC output for example , etc)
As long as it doesn't conflict with transaction protocol rules then it's "valid"
Nonstandard transactions are the ones that don't follow the script templates of the reference software eg P2PKH, P2SH, etc.
Nonstandard transactions can be included in a block (as long as they follow the rules), but invalid transactions cannot be included in a block.
For example,
this transaction spending 0.02BTC is nonstandard, but not invalid, even though it's outputs can't be redeemed.