Ok so you have the option to marry now and adjust status as this was not your plan when you entered the US. But be prepared to be stuck in the US, no working not even remote jobs, no US driver's license until EAD is in hand or the GC and now you have to apply and pay extra for it, the extra fee for AP to allow travel out of the US if there are any emergencies.
If you marry now and go home yes you would apply for the spousal visa. It does take awhile up to two years, but much more freedom when you arrive.