It's better to know nothing at all than to have a half-baked understanding.
Literal
Things [object-を] half-heartedly know-than, completely not-know side [subject-が] better.
中途半端に知っているより uses ~より (than) to set up a comparison. 全く知らない方がましだ means 'the side of knowing nothing at all is better.' ましだ means 'better (of two bad options)' — a nuanced comparative.