To my eyes, what "the law" is is actually immaterial to the story's point. It's something the protagonist desperately desires, and the story is about how he goes about trying to attain that desire and what stands in his way. That's the important part.
To me, it was getting obsessed with breaking through the first obstacle, but forgetting the eventual end goal. Despite gifts and conversation, he never once made his own luck. He trusted that the guardian was telling the truth, until it was too late for him to even try. Better to fall down trying than to never succeed without even attempting. I've never been one for literary analysis, however, and may be missing the point.
Part of the story does have to do with the protagonist's passivity and lack of initiative, but also with his deference to authority. Kafka has the gatkeeper speak in ambiguous ways, hinting at something that's never made clear. Is he on the supplicant's side, or is he against him? Does he wield vast power, or is it all a bluff?
Kafka does not give us any answers to these questions, but really challenges us to reflect on them ourselves, and to perhaps see some parallels to this in our own lives. The whole story could be seen as a miniature version of all too many desperate, futile lives that people live today -- they yearn for something, but meekly, perhaps out of some defect in their characters (a defect but perhaps also a virtue -- that of trust and obedience or deference to authority) fail to attain what they yearn for.
We could probably go on analyzing this tale for some time. I find the it to be quite deep and rich in meaning, and that's why I love it.
I'd like to offer a different perspective. I read this story in high school in class.
Kafka intended to be a chemical engineer, but he studied law at his father's request. He had talent for writing, but stuck being a clerk drafting legal documents.
I had (have) a very similar story. At the time I read Kafka's "the process" and then consecutively this story, I had felt helplessness in insufferable amount. Computers were all that interested me, I believed I was really talented, I always believed that İ had a calling.
But in real life, I had little prospects for getting into college, although I was a real good student.
At the end I conceded like I always do, and started Law School.
I guess Kafka's trying to say that don't be a conformist, stand up for your self.
The protagonist (of the Process, which includes this story as far as I can remember) had a job (but he didn't like it), he had a girlfriend (but he didn't care for it). He didn't enjoy life, he
He believed that he had to accept everything imposed upon him and this got him killed.
[1] - http://records.viu.ca/~johnstoi/kafka/beforethelaw.htm