If you decide you want to live near the coast, be aware that properties just a few kilometres inland form popular coastal resorts can be several thousdands of euros cheaper than those right on the coast.
Your next step is to narrow your search down to a region. Spain is a very large country, so you need to focus on the region you would prefer to buy your property in, or your search could take forever. Be aware that prices for similar properties will be different in different regions. A two-bedroom apartment in a popular tourist resort will be more expensive than an identical property in a rural village.
The climate throughout Spain is essentially sunny for most of the year, but conditions can be very different in various parts of Spain. The south and east coasts tend to have mild days and cold nights in winter and they are very warm in summer. Away from the coasts, winters tend to be very cold, especially at night, while the summers are stifling. Northwest Spain has less extreme weather.
The reason you are buying property will also be important in choosing your area. If you are planning to live in Spain, you may need to take local employment opportunities into account. If you are bringing children to live, under Spanish law they will have to attend school, so you will want to ensure there are educational facilities nearby.
Language may be another consideration if you intend to live or work in the country. In the most popular tourist areas, staff in most shops, bars, restaurants and offices will speak a reasonable amount English. You will also be more likely to find English-speaking lawyers, dentists, pharmacists, doctors etc. If you move to an area away from the tourist resorts, you will almost certainly have to become reasonably competent in Spanish.