It is in a subjunctive mood since the underlined word is were. You are likely dealing with a unreal conditional sentence.
Kafka choose it because of the perception that a bug is perceived as a mindless systematic creature, a metaphor for the way Gregor lives his life, and acts in society