You may enter a plea while asserting your innocence to avoid the risk of a more severe sentence. See NorthCarolina v. Alford (1970) 400 U.S. 25, 36.
The above is not intended as legal advice. The response does not constitute the creation of an attorney client relationship as this forum does not provide for a confidential communication.
As another attorney has indicated you can try to enter an Alford plea. Ultimately it is up to the court to decide if it will accept or reject such a plea. The judge refused to accept your plea because during the plea hearing you stated you were innocent. When a person claims they are innocent and that they have a defense under a non-Alford plea the court always should reject the plea offer.
It is up to the court as to whether a plea agreement will be followed. It sounds like the reason that the court rejected the plea agreement is because you said you were innocent. In order to get a plea agreement one must enter a guilty plea. If you are innocent you should get an attorney and fight the charge.
Call an attorney as soon as possible. They can help you through to process. The court probably didn't except your plea because you claimed you were innocent.
Kennedy Law Office, PLLC
Disclaimer: No attorney-client relationship has been established. Please contact an attorney about your legal rights. This answer is for educational purposes only.
In order to accept your plea a judge has to be convinced that you have provided what is known as a sufficeint factual basis for pleading guilty. So you must first admit your guilt clearly and without doubt in order for the judge to accept it. You may still have a chance to do this, if that's what you want to do--but I would repeat the advice that you first discuss this matter with an attorney that knows the court where you are facing charges.