You can get a job in the USA from Morocco by first getting employed at a US-based company in Morocco and requesting them to sponsor your H-1B work visa so you can relocate to their US office. You could also come to the US as a student, secure employment after your studies and obtain an H1-B visa.