Your boyfriend's citizenship will have no impact on the validity of the marriage. As long as you comply with the laws for the jurisdiction in which you are married, you are legally married in that jurisdiction. Whether Brazil will honor or recognize the marriage is a whole different issue.
Please be advised that any information or advice given herein does not constitute an attorney client relationship. Further, before taking any actions or deciding not to take any actions, you should seek counsel of an attorney. This forum cannot provide you with the anyalysis and detail necessary for a full and accurate opinion to be rendered.
A government within the USA cannot discriminate in application of the law based on race, religion, or national origin.
So you should be able to marry just as you would a US citizen.
Then if your spouse wants to stay in the US you have a different set of rules to deal with, but it does not sound as if he wants to stay past his student Visa anyway.