Why can't I buy stock options on the day of expiry?

The stock option contracts are due for physical settlement on the day of expiry i.e. Thursday, due to this there is a possibility of margin requirement to increase exponentially. Since stock options are illiquid it would become difficult to exit the contract, in turn increasing the risk for the brokerage firm.

You will, however, be allowed to exit the open short positions for the quantity you hold on the day of expiry.