They measure slightly different things and need not give the same answers.
Chi-square measures association. It treats neither variable as dependent or independent. It can handle mxn tables, where the only limit is sample size, and gives one statistic for the whole table which is relatively easy to interpret.
Logistic regression does treat one variable as dependent. If the dependent variable has a lot of levels, interpretation can be tricky and there will be a lot of parameters to estimate.
See this thread (which is not quite a duplicate, I think)