When it is necessary to use Classes in PHP
No, it's not compulsory, nor does it increase security per-se. it's just a different style of programming.
Most programmers would agree that object-oriented programming (classes) has many advantages over modular programming (functions). But that's more of a religious debate that I'd rather not get into :)