The king believes that Hamlet's strange behavior stems from Ophelia's neglect. This is because the king overhears a conversation between Hamlet and Ophelia where Hamlet expresses his feelings of betrayal and abandonment by Ophelia. This leads the king to conclude that Hamlet's erratic behavior is a result of feeling neglected by Ophelia.
The king does not believe that Hamlet's behavior is due to Ophelia's pregnancy or moving to Spain because there is no evidence or indication of these factors being the cause of Hamlet's distress in the play. It is specifically Ophelia's neglect towards Hamlet that the king focuses on as the reason behind Hamlet's behavior.