This behavior is due to precision limitations of floating-point arithmetic. When specifying an interval [a,b] in steps of d using the colon operator (a:d:b), MATLAB generates the first half of the interval using a+xd and the latter half using b-xd, where x is a natural number.
As a result, there is a greater accumulation of rounding errors toward the middle of the generated vector. Any subsequent arithmetic/relational operations on the vector may produce unexpected results because of these rounding errors.
Use best practices when writing code to perform such operations on floating point numbers. Suggestions can be found in this related MATLAB Answers post.